gPanel icon indicating copy to clipboard operation
gPanel copied to clipboard

Allow usage of POST/GET variables with PHP

Open george-e-shaw-iv opened this issue 7 years ago • 9 comments

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:

george-e-shaw-iv avatar Feb 12 '18 20:02 george-e-shaw-iv

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

ghost avatar Apr 11 '18 18:04 ghost

@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 :/

george-e-shaw-iv avatar Apr 11 '18 20:04 george-e-shaw-iv

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.

ghost avatar Apr 11 '18 21:04 ghost

@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

george-e-shaw-iv avatar Apr 12 '18 20:04 george-e-shaw-iv

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.

ghost avatar Apr 12 '18 22:04 ghost

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.

ctd1500 avatar Apr 13 '18 02:04 ctd1500

@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.

george-e-shaw-iv avatar Apr 13 '18 18:04 george-e-shaw-iv

@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.

ctd1500 avatar Apr 14 '18 02:04 ctd1500

@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

george-e-shaw-iv avatar Apr 16 '18 20:04 george-e-shaw-iv