HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   php as cgi (http://www.howtoforge.com/forums/showthread.php?t=3328)

thedoc 24th March 2006 21:34

php as cgi
 
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

Quote:

Originally Posted by thedoc
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

apache user problem
 
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
Code:

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

php woes
 
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
Code:

chown -R www-data:www-data /path/to/forms_directory

thedoc 27th March 2006 16:07

php woes
 
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

got it done
 
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
Code:

ls -l /usr/lib/php4/20020429/ming.so
?
Is ming.so mentioned somewhere in your php.ini?

thedoc 29th March 2006 10:12

ming.so
 
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


All times are GMT +2. The time now is 17:04.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.