kentonh / gPanel

A web-hosting control panel written in Go.
MIT License
80 stars 25 forks source link

Allow usage of POST/GET variables with PHP #137

Open george-e-shaw-iv opened 6 years ago

george-e-shaw-iv commented 6 years ago

Severity level (1-10):

10

Files/Directories Involved:

pkg/public/servehttp.go

Description:

Something with the php-cgi command has to be changed. There is really little to no documentation that I know of over this command, but I found two stackoverflow posts that may help. I think the second of one the two is the best option.

https://stackoverflow.com/questions/4030147/how-to-pass-post-data-to-the-php-cgi https://serverfault.com/questions/187025/how-to-pass-get-variables-to-a-php-script-via-the-command-line/187038

Personal Comments:

ghost commented 6 years ago

You may want to post here for this question => http://php.net/manual/en/install.unix.commandline.php

george-e-shaw-iv commented 6 years ago

@KipOmaha I wanted to do that, but it says in their guidelines not to post questions in the user contributed notes, that they'll just get flagged and deleted :/

ghost commented 6 years ago

I'm sorry I wasn't being helpful, I believe it has to do with the build config you are on for php/cgi. In anycase it sounds like you need to look into ensuring you have the right build of php for the task. :(

Also I wasn't sure which file you were talking about in your issue pkgs/public/httpserve.php wasn't there, instead there was pkgs/public/httpserve.go, I'm not to familiar with the go language.

george-e-shaw-iv commented 6 years ago

@KipOmaha Yes you're right it should have been pkg/public/httpserve.go

I'm using the newest version of the CGI, I just think that there has to be some sort of a shell script that is written on the fly that contains certain variables like content length and the amount of post variables/etc. like its written in https://stackoverflow.com/questions/4030147/how-to-pass-post-data-to-the-php-cgi

ghost commented 6 years ago

I looked at that and found that the guy was having issues with CONTENT_LENGTH not being set.

Sorry I can't be more help, I'll probably be having this issue in the near future with cgi/python/php...so I thought I would help out and look into it.

I did find this go lib for php data bindings => https://github.com/deuill/go-php and this issue => https://github.com/deuill/go-php/issues/51

I'm not a go guy but am a php guy, do you think go is the way or is its use specific for this project? Maybe I should look at Go to and experiment.

ctd1500 commented 6 years ago

Unless you're dead-set on CGI, you may consider looking into FastCGI, it's what Apache, Nginx, and Caddy now use for PHP with PHP-FPM. It's much faster than old CGI.

george-e-shaw-iv commented 6 years ago

@ctd1500 I was wanting to use fastCGI but when I was looking around for documentation concerning it I couldn't find anything other than webpages telling me that it was deprecated/not maintained for a long time. Do you know where I can find some documentation concerning it and its use? I would love to use it.

@KipOmaha I saw those but it looked like it wasn't full-featured when I looked at it, and it looks to still be that way. On top of that, it would always lag behind the newest version of PHP, which would be kind of unfortunate at times, so I think using some sort of CGI would probably be the way to go.

ctd1500 commented 6 years ago

@george-e-shaw-iv As of PHP 5.3.3 php-fpm is in the PHP core, so the old FPM website hadn't been updated in a while which may be what you saw as un-maintained. Concerning usage, it's still FastCGI, so any fcgi client implementation can handle it, like the one Caddy uses, or another such as gofast.

george-e-shaw-iv commented 6 years ago

@ctd1500 Okay thank you for this information, I'll look into the libraries when I get the time and play around with it and see how it can work itself into gPanel in some way