View Full Version : php as cgi
thedoc
24th March 2006, 21:34
Okay here is my new problem. I have given up on Fedora and have now gone with Falko's choice of Debian Sarge. I want to be able to use phpformgenerator on my website. When I was using a trial version of plesk I was able to use it with no problem but plesk configures php as cgi. Here is what happens. I go through all the steps to create my form and run the creation process. When complete the program provides me with a link to view the page. It is generated in html format with (i believe POST) and then the form sends to my email address, but when I click on the link the page is not found. I go to the directory in which the page is stored in on my website and the folder is empty. So the page is not generated. So my question is how do I run both php4 and php5 as cgi instead of the standard install. And both having all options available for creation. So far you guys have been great and I hope you can help me with this one. Thank you again!
falko
25th March 2006, 14:39
So my question is how do I run both php4 and php5 as cgi instead of the standard install.Have a look here: http://www.howtoforge.com/apache2_with_php5_and_php4
But I don't think your problem is related to this. I'm sure it's a permissions problem. You're running the phpformgenerator script as the Apache user, and the script tries to write the form to a directory, and I guess that the Apache user does not have write privileges for that directory.
thedoc
25th March 2006, 20:17
Okay if it is a permission problem then how would I go about correcting this? Is there an how to for changing permissions in apache? I have set the directory permissions to 777 for the forms. I apologize for what may appear to be a stupid question.
falko
26th March 2006, 11:06
What's the directory where you expect the forms to be saved?
Please post the output of ls -la /path/to/that/directory
What's your Apache user?
Which distribution do you use?
Anything in the Apache error log?
thedoc
27th March 2006, 09:08
okay here is the output of the ls -la:
drwxrwxrwx 4 dorr web1 4096 Mar 27 01:46 .
drwxr-xr-x 5 dorr web1 4096 Mar 27 01:46 ..
-rwxrwxrwx 1 dorr web1 8704 Mar 27 01:46 Thumbs.db
drwxrwxrwx 2 dorr web1 4096 Mar 27 01:46 admin
-rwxrwxrwx 1 dorr web1 979 Mar 27 01:46 bc_new.gif
-rwxrwxrwx 1 dorr web1 9231 Mar 27 01:46 button.jpg
drwxrwxrwx 2 dorr web1 4096 Mar 27 01:46 files
-rwxrwxrwx 1 dorr web1 1830 Mar 27 01:50 form1.html
-rwxrwxrwx 1 dorr web1 929 Mar 27 01:46 form2.html
-rwxrwxrwx 1 dorr web1 839 Mar 27 01:46 global.inc.php
-rwxrwxrwx 1 dorr web1 53 Mar 27 01:46 nav_m.gif
-rwxrwxrwx 1 dorr web1 811 Mar 27 01:50 process.php
-rwxrwxrwx 1 dorr web1 157 Mar 27 01:46 tile_back.gif
-rwxrwxrwx 1 dorr web1 155 Mar 27 01:46 tile_sub.gif
apache user is www-data
apache group is www-data
Debian Sarge 3.1 with php5 and php4 as cgi and mysql 5
apache error log errors (the whole file):
[Mon Mar 27 01:50:52 2006] [Sun Mar 26 23:39:06 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) configured -- resuming normal$
[Sun Mar 26 23:39:36 2006] [notice] caught SIGTERM, shutting down
[Sun Mar 26 23:39:42 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) configured -- resuming normal operations
[Sun Mar 26 23:39:42 2006] [notice] caught SIGTERM, shutting down
[Sun Mar 26 23:39:43 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) PHP/5.1.2-1.dotdeb.2 configured -- resuming normal opera$
[Sun Mar 26 23:43:17 2006] [notice] caught SIGTERM, shutting down
[Sun Mar 26 23:43:18 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20050922/ming.so' - libming.so: cannot open shared o$
[Sun Mar 26 23:43:20 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) PHP/5.1.2-1.dotdeb.2 mod_ssl/2.0.54 OpenSSL/0.9.7e confi$
[Mon Mar 27 01:16:25 2006] [notice] SIGHUP received. Attempting to restart
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20050922/ming.so' - libming.so: cannot open shared o$
[Mon Mar 27 01:16:28 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) PHP/5.1.2-1.dotdeb.2 mod_ssl/2.0.54 OpenSSL/0.9.7e confi$
[Mon Mar 27 01:16:34 2006] [notice] caught SIGTERM, shutting down
[Mon Mar 27 01:16:35 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20050922/ming.so' - libming.so: cannot open shared o$
[Mon Mar 27 01:16:36 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) PHP/5.1.2-1.dotdeb.2 mod_ssl/2.0.54 OpenSSL/0.9.7e confi$
[Mon Mar 27 01:41:00 2006] [notice] Graceful restart requested, doing restart
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20050922/ming.so' - libming.so: cannot open shared o$
[Mon Mar 27 01:41:01 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) PHP/5.1.2-1.dotdeb.2 mod_ssl/2.0.54 OpenSSL/0.9.7e confi$
[Mon Mar 27 01:41:01 2006] [warn] long lost child came home! (pid 19160)
[Mon Mar 27 01:49:21 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:49:21 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:01 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:01 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:06 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:06 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:16 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:16 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:18 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:18 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:36 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:36 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:52 2006] [error] an unknown filter was not added: PHP
[Mon Mar 27 01:50:52 2006] [error] an unknown filter was not added: PHP
thanks falko you've been great :D
falko
27th March 2006, 14:21
You can try chown -R www-data:www-data /path/to/forms_directory
thedoc
27th March 2006, 16:07
Okay we're getting there now. Now I got these two errors though:
Warning: fopen() [function.fopen]: SAFE MODE Restriction in effect. The script whose uid is 10001 is not allowed to access forms/form1.html owned by uid 33 in /var/www/web1/web/phpform/process3.php on line 467
Warning: fopen(forms/form1.html) [function.fopen]: failed to open stream: Success in /var/www/web1/web/phpform/process3.php on line 467
cannot create file
I think if I can get past these we'll be in working order. Thanks again for your time.
Here is the line in question:
$out=fopen("forms/form1.html","w") or die ("cannot create file")
And also what does this error mean:
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/20020429/ming.so' - libming.so: cannot open shared object file: No such file or directory in Unknown on line 0
thedoc
27th March 2006, 18:22
Falko thank you so much for your help. I got it figured out. I had to give apache permissions on the whole folder. I would still like to know about the libming.so error. Your help in this matter is greatly appreciated. As far as I can figure out the libming.so module is no where on my system / hence the error. Thank you again for all of your help.
Here is the error in question:
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/20020429/ming.so' - libming.so: cannot open shared object file: No such file or directory in Unknown on line 0
falko
28th March 2006, 11:07
What's the output of ls -l /usr/lib/php4/20020429/ming.so?
Is ming.so mentioned somewhere in your php.ini?
thedoc
29th March 2006, 10:12
The output of the command you listed is:
ls: /usr/lib/php4/20020429/ming.s: No such file or directory
ming.so is listed but libming.so is not. I found the error in my apache error log file and then when I type php -v this is my output:
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/20020429/ming.so' - libming.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 4.4.2-0.dotdeb.1 (cli) (built: Jan 13 2006 16:48:04)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
falko
29th March 2006, 13:43
ls: /usr/lib/php4/20020429/ming.s: No such file or directory
I don't know if it's a typo or if you used the wrong command, bot the o at the end is missing: ming.so
ming.so is listed but libming.so is not.
Can you post the excerpt from php.ini where ming.so is listed?
Please do this:
apt-get install apt-file
apt-file update
apt-file search ming.soWhat's the output of the last command?
thedoc
29th March 2006, 19:55
here is the output from apt-file search:
apache-common: usr/lib/apache/1.3/mod_roaming.so
ethereal-common: usr/lib/ethereal/plugins/0.10.10/cosnaming.so
liborbit-dev: usr/lib/libORBitCosNaming.so
liborbit0: usr/lib/libORBitCosNaming.so.0
liborbit0: usr/lib/libORBitCosNaming.so.0.5.17
libtao-orbsvcs-dev: usr/lib/libTAO_CosNaming.so
libtao-orbsvcs1.4: usr/lib/libTAO_CosNaming.so.1.4.2
neverdata: usr/share/games/neverdata/map-putt/17_timing.sol
python2.1: usr/lib/python2.1/lib-dynload/timing.so
python2.2: usr/lib/python2.2/lib-dynload/timing.so
python2.3: usr/lib/python2.3/lib-dynload/timing.so
python2.4: usr/lib/python2.4/lib-dynload/timing.so
python2.4-dbg: usr/lib/debug/usr/lib/python2.4/lib-dynload/timing.so
python2.4-dbg: usr/lib/python2.4/lib-dynload/debug/timing.so
simgear-dev: usr/lib/libsgtiming.so
simgear0: usr/lib/libsgtiming.so.0
simgear0: usr/lib/libsgtiming.so.0.3.7
And this is in my php.ini
extension=ming.so
falko
29th March 2006, 20:11
here is the output from apt-file search:
apache-common: usr/lib/apache/1.3/mod_roaming.so
ethereal-common: usr/lib/ethereal/plugins/0.10.10/cosnaming.so
liborbit-dev: usr/lib/libORBitCosNaming.so
liborbit0: usr/lib/libORBitCosNaming.so.0
liborbit0: usr/lib/libORBitCosNaming.so.0.5.17
libtao-orbsvcs-dev: usr/lib/libTAO_CosNaming.so
libtao-orbsvcs1.4: usr/lib/libTAO_CosNaming.so.1.4.2
neverdata: usr/share/games/neverdata/map-putt/17_timing.sol
python2.1: usr/lib/python2.1/lib-dynload/timing.so
python2.2: usr/lib/python2.2/lib-dynload/timing.so
python2.3: usr/lib/python2.3/lib-dynload/timing.so
python2.4: usr/lib/python2.4/lib-dynload/timing.so
python2.4-dbg: usr/lib/debug/usr/lib/python2.4/lib-dynload/timing.so
python2.4-dbg: usr/lib/python2.4/lib-dynload/debug/timing.so
simgear-dev: usr/lib/libsgtiming.so
simgear0: usr/lib/libsgtiming.so.0
simgear0: usr/lib/libsgtiming.so.0.3.7
Ok, there doesn't seem to be a package which contains ming.so.
And this is in my php.ini
extension=ming.soComment it out:
;extension=ming.so and restart Apache.
avi123
23rd September 2006, 22:31
I tired commenting out ming.so in the php.ini file, however i still get the same error.
php -v
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/20020429/ming.so' - libming.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 4.4.4-0.dotdeb.1 (cli) (built: Aug 21 2006 16:07:30)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
falko
24th September 2006, 14:49
I tired commenting out ming.so in the php.ini file, however i still get the same error.
In the correct php.ini? What's the output of updatedb
locate php.ini?
ciprianz
28th December 2006, 17:40
I have almost the same problem
[Thu Dec 28 18:30:37 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/20050606/ming.so' - /usr/lib/php4/20050606/ming.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
locate php.ini produces the following
isp:/usr/lib/apache2# locate php.ini
/etc/php4/apache2/php.ini
/etc/php4/cli/php.ini
/etc/php5/apache/php.ini
/root/kit/install_ispconfig/compile_aps/php.ini
/usr/share/doc/php4-common/examples/php.ini-dist
/usr/share/doc/php4-common/examples/php.ini-paranoid
/usr/share/doc/php4-common/examples/php.ini-recommended
/usr/share/doc/php5-common/examples/php.ini-dist
/usr/share/doc/php5-common/examples/php.ini-paranoid
/usr/share/doc/php5-common/examples/php.ini-recommended
/usr/share/php4/php.ini-dist
/usr/share/php4/php.ini-dist.cli
/usr/share/php5/php.ini-dist
/usr/share/php5/php.ini-dist.cli
I don't think that it is a solution but i removed php4
apt-get remove php4 --purge
and I don't get any error at all
[Thu Dec 28 18:44:36 2006] [notice] caught SIGTERM, shutting down
[Thu Dec 28 18:44:37 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
[Thu Dec 28 18:44:39 2006] [notice] Apache/2.0.54 (Debian GNU/Linux) PHP/4.4.4-0.dotdeb.3 with Suhosin-Patch mod_ssl/2.0.54 OpenSSL/0.9.7e mod_perl/1.999.21 Perl/v5.8.4 configured -- resuming normal operations
ciprianz
28th December 2006, 18:14
I removed all my previous installation php and php modules
apt-get remove php* --purge
after that I had to delete manually /etc/php5/ , because I got this Error
dpkg - warning: while removing php5-common, directory `/etc/php5/conf.d' not empty so not removed.
dpkg - warning: while removing php5-common, directory `/etc/php5' not empty so not removed.
There is a file with a reference to ming.so, maybe thats why we got the error with "Unable..."
I followed the tutorial again with one small exception
be careful what modules you install.
I installed only this:
apt-get install php5-curl php5-dev php5-gd php5-gmp php5-imap php5-ldap php5-mcrypt php5-mhash php5-mysql php5-pspell php5-snmp php5-sybase php5-tidy php4-curl php4-domxml php4-gd php4-gmp php4-imap php4-ldap php4-mcal php4-mcrypt php4-mhash php4-mysql php4-odbc php4-pspell php4-recode php4-snmp php4-xslt php4-xdebug curl libwww-perl imagemagick
Anyway I don't need the ming mod so all is good for me now :)
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.