Hi List,

I have a problem with apache and php and hope you guys (and gals!) can help me.

This is what I did/tried up to now.

Activated apache, enabled ssl and changed config, so apache is reachable via IPv4 and v6...no further changes to httpd.conf

Installed php-5.3.14p1.tgz and create the syslink as I were told (as far as I can see, there should be no necessity to do further configuration...or am I wrong?)

created a php script consisting of:

# cd /var/www/cgi-bin/
# cat phpinfo.php
<? phpinfo(); ?>
#


When I navigate to the phpinfo.php script, I get an error 500 and the log tells me this:

[Mon Feb 4 18:27:01 2013] [error] (8)Exec format error: exec of /var/www/cgi-bin/phpinfo.php failed [Mon Feb 4 18:27:01 2013] [error] [client ] Premature end of script headers: /var/www/cgi-bin/phpinfo.php [Mon Feb 4 18:27:01 2013] [error] [client ] File does not exist: /var/www/htdocs/favicon.ico


As far as I can see, the webserver tries to run the script like a binary cause of the missing shebang.
Why doesn't he run it like a php script, as supposed?

I dont know, how to tell apache to run the php script...IMHO this should be sufficient to tell him so:

# cat /var/www/conf/modules/php.conf
LoadModule php5_module /usr/local/lib/php-5.3/libphp5.so

<IfModule mod_php5.c>
        AddType application/x-httpd-php .php .phtml .php3
        AddType application/x-httpd-php-source .phps
# Most php configs require this
        DirectoryIndex index.php
</IfModule>
#


I even disabled chroot (I expected no difference but I was desperate enough to try) and changed the permissions to the relaxed settings possible (test-cgi runs fine)
# ls -lh /var/www/cgi-bin/
total 288
----------  1 root  bin   137K Aug  1  2012 bgplg
-rwxrwx---  1 www   www    17B Feb  3 22:27 phpinfo.php
----------  1 root  bin   268B Aug  1  2012 printenv
-rwxrwx---  1 www   www   757B Aug  1  2012 test-cgi
#

Can anybody help me to get this php thing working, I dont want to write my web-scripts in C ;-)


Regards,

Matthias

Reply via email to