php as cgi

Discussion in 'Installation/Configuration' started by thedoc, Mar 24, 2006.

  1. thedoc

    thedoc New Member

    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!
     
  2. falko

    falko Super Moderator Howtoforge Staff

    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.
     
  3. thedoc

    thedoc New Member

    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.
     
    Last edited: Mar 25, 2006
  4. falko

    falko Super Moderator Howtoforge Staff

    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?
     
  5. thedoc

    thedoc New Member

    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
     
  6. falko

    falko Super Moderator Howtoforge Staff

    You can try
    Code:
    chown -R www-data:www-data /path/to/forms_directory
     
  7. thedoc

    thedoc New Member

    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
     
    Last edited: Mar 27, 2006
  8. thedoc

    thedoc New Member

    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
     
  9. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -l /usr/lib/php4/20020429/ming.so
    ?
    Is ming.so mentioned somewhere in your php.ini?
     
  10. thedoc

    thedoc New Member

    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
     
  11. falko

    falko Super Moderator Howtoforge Staff

    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

    Can you post the excerpt from php.ini where ming.so is listed?

    Please do this:
    Code:
    apt-get install apt-file
    apt-file update
    apt-file search ming.so
    What's the output of the last command?
     
  12. thedoc

    thedoc New Member

    ming.so

    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
     
  13. falko

    falko Super Moderator Howtoforge Staff

    Ok, there doesn't seem to be a package which contains ming.so.

    Comment it out:
    Code:
    ;extension=ming.so
    and restart Apache.
     
  14. avi123

    avi123 New Member

    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
     
  15. falko

    falko Super Moderator Howtoforge Staff

    In the correct php.ini? What's the output of
    Code:
    updatedb
    locate php.ini
    ?
     
  16. ciprianz

    ciprianz New Member

    same problem

    I have almost the same problem
    locate php.ini produces the following
    I don't think that it is a solution but i removed php4
    and I don't get any error at all
     
    Last edited: Dec 28, 2006
  17. ciprianz

    ciprianz New Member

    solved

    I removed all my previous installation php and php modules
    after that I had to delete manually /etc/php5/ , because I got this Error
    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:


    Anyway I don't need the ming mod so all is good for me now :)
     

Share This Page