I have set up a local webserver for testing static html (of which I have some basic knowledge) and dynamic html (which is quite new to me). After I had set proper permissions on /var/www/ and had copied my testfiles to the appropriate locations, httpd worked out of the box (i. e. with the original httpd.conf that came with Fedora 16). I could run Perl scripts (e. g. a guestbook) in cgi-bin, but no PHP scripts. Apache's error log gave:
(8)Exec format error: exec of '/var/www/cgi-bin/test.php' failed Premature end of script headers: test.php
The script test.php simply calls phpinfo() and works on my hired external webspace, so this must be a configuration issue with my local webserver. Strange enaugh, I didn't find many clues on enabling PHP in the Apache.org documentation and even elsewhere.
Thanks for any pointers Klaus
De: Klaus-Peter Schrage kpschrage@gmx.de Para: Fedora users@lists.fedoraproject.org Enviado: Miércoles, 28 de diciembre, 2011 8:28:44 Asunto: Enable PHP on local Apache2 server
I have set up a local webserver for testing static html (of which I have some basic knowledge) and dynamic html (which is quite new to me). After I had set proper permissions on /var/www/ and had copied my testfiles to the appropriate locations, httpd worked out of the box (i. e. with the original httpd.conf that came with Fedora 16). I could run Perl scripts (e. g. a guestbook) in cgi-bin, but no PHP scripts. Apache's error log gave:
(8)Exec format error: exec of '/var/www/cgi-bin/test.php' failed Premature end of script headers: test.php
The script test.php simply calls phpinfo() and works on my hired external webspace, so this must be a configuration issue with my local webserver. Strange enaugh, I didn't find many clues on enabling PHP in the Apache.org documentation and even elsewhere.
Thanks for any pointers Klaus
-- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
Try moving the file to /var/www/html/test.php
DK
Am 28.12.2011 15:35, schrieb Dennis Kaptain:
------------------------------------------------------------------------ *De:* Klaus-Peter Schrage <kpschrage@gmx.de> *Para:* Fedora <users@lists.fedoraproject.org> *Enviado:* Miércoles, 28 de diciembre, 2011 8:28:44 *Asunto:* Enable PHP on local Apache2 server I have set up a local webserver for testing static html (of which I have some basic knowledge) and dynamic html (which is quite new to me). After I had set proper permissions on /var/www/ and had copied my testfiles to the appropriate locations, httpd worked out of the box (i. e. with the original httpd.conf that came with Fedora 16). I could run Perl scripts (e. g. a guestbook) in cgi-bin, but no PHP scripts. Apache's error log gave: (8)Exec format error: exec of '/var/www/cgi-bin/test.php' failed Premature end of script headers: test.php The script test.php simply calls phpinfo() and works on my hired external webspace, so this must be a configuration issue with my local webserver. Strange enaugh, I didn't find many clues on enabling PHP in the Apache.org documentation and even elsewhere. Thanks for any pointers Klaus -- users mailing list users@lists.fedoraproject.org <mailto:users@lists.fedoraproject.org> To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org Try moving the file to /var/www/html/test.php DK
Thanks, but than calling /localhost/test.php simply lists the contents of test.php
Am 28.12.2011 15:46, schrieb Reindl Harald:
Am 28.12.2011 15:42, schrieb Klaus-Peter Schrage:
Try moving the file to /var/www/html/test.php DK
Thanks, but than calling /localhost/test.php simply lists the contents of test.php
well, have you installed PHP? what says "rpm -qa | grep php"?
Quite a lot: php-cli-5.3.8-3.fc16.x86_64 php-ldap-5.3.8-3.fc16.x86_64 php-pdo-5.3.8-3.fc16.x86_64 php-mysql-5.3.8-3.fc16.x86_64 php-5.3.8-3.fc16.x86_64 php-common-5.3.8-3.fc16.x86_64
Am 28.12.2011 15:49, schrieb Klaus-Peter Schrage:
Am 28.12.2011 15:46, schrieb Reindl Harald:
Am 28.12.2011 15:42, schrieb Klaus-Peter Schrage:
Try moving the file to /var/www/html/test.php DK
Thanks, but than calling /localhost/test.php simply lists the contents of test.php
well, have you installed PHP? what says "rpm -qa | grep php"?
Quite a lot: php-cli-5.3.8-3.fc16.x86_64 php-ldap-5.3.8-3.fc16.x86_64 php-pdo-5.3.8-3.fc16.x86_64 php-mysql-5.3.8-3.fc16.x86_64 php-5.3.8-3.fc16.x86_64 php-common-5.3.8-3.fc16.x86_64
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Has your Script "<?php" at the begin or does it only start with "<?" which will not work as long "short_open_tag" is not enabled?
Am 28.12.2011 15:55, schrieb Reindl Harald:
Am 28.12.2011 15:49, schrieb Klaus-Peter Schrage:
Am 28.12.2011 15:46, schrieb Reindl Harald:
Am 28.12.2011 15:42, schrieb Klaus-Peter Schrage:
Try moving the file to /var/www/html/test.php DK
Thanks, but than calling /localhost/test.php simply lists the contents of test.php
well, have you installed PHP? what says "rpm -qa | grep php"?
Quite a lot: php-cli-5.3.8-3.fc16.x86_64 php-ldap-5.3.8-3.fc16.x86_64 php-pdo-5.3.8-3.fc16.x86_64 php-mysql-5.3.8-3.fc16.x86_64 php-5.3.8-3.fc16.x86_64 php-common-5.3.8-3.fc16.x86_64
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
But it still seems strange to me that loading the php module isn't an option in httpd.conf. Thanks anyway
Am 28.12.2011 16:10, schrieb Klaus-Peter Schrage:
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
But it still seems strange to me that loading the php module isn't an option in httpd.conf. Thanks anyway
server-setup is usually nothing whar anybody should do like turning on a toaster setup a webserver is a REAL complex thing and dangerous if it is not done well
Am 28.12.2011 16:13, schrieb Reindl Harald:
Am 28.12.2011 16:10, schrieb Klaus-Peter Schrage:
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
But it still seems strange to me that loading the php module isn't an option in httpd.conf. Thanks anyway
server-setup is usually nothing whar anybody should do like turning on a toaster setup a webserver is a REAL complex thing and dangerous if it is not done well
That's why I asked: I am willing to learn (even at the age of 64) ...
On 12/28/2011 08:28 AM, Klaus-Peter Schrage wrote:
I have set up a local webserver for testing static html (of which I have some basic knowledge) and dynamic html (which is quite new to me). After I had set proper permissions on /var/www/ and had copied my testfiles to the appropriate locations, httpd worked out of the box (i. e. with the original httpd.conf that came with Fedora 16). I could run Perl scripts (e. g. a guestbook) in cgi-bin, but no PHP scripts. Apache's error log gave:
(8)Exec format error: exec of '/var/www/cgi-bin/test.php' failed Premature end of script headers: test.php
The script test.php simply calls phpinfo() and works on my hired external webspace, so this must be a configuration issue with my local webserver. Strange enaugh, I didn't find many clues on enabling PHP in the Apache.org documentation and even elsewhere.
Thanks for any pointers Klaus
The scripts should be in your regular web tree, not in /cgi-bin. Do you have all the necessary php stuff installed?
yum install php php-devel php-pear php-mysql
After installing PHP, restart httpd and try your phpinfo() test again with the file in /var/www/html
Le 28/12/2011 16:10, Klaus-Peter Schrage a écrit :
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
This 2 lines should be present in /etc/httpd/conf.d/php.conf, provided by php package.
So httpd.conf doesn't have to be modified.
Remi.
On 12/28/2011 09:10 AM, Klaus-Peter Schrage wrote:
Am 28.12.2011 15:55, schrieb Reindl Harald:
Am 28.12.2011 15:49, schrieb Klaus-Peter Schrage:
Am 28.12.2011 15:46, schrieb Reindl Harald:
Am 28.12.2011 15:42, schrieb Klaus-Peter Schrage:
Try moving the file to /var/www/html/test.php DK
Thanks, but than calling /localhost/test.php simply lists the contents of test.php
well, have you installed PHP? what says "rpm -qa | grep php"?
Quite a lot: php-cli-5.3.8-3.fc16.x86_64 php-ldap-5.3.8-3.fc16.x86_64 php-pdo-5.3.8-3.fc16.x86_64 php-mysql-5.3.8-3.fc16.x86_64 php-5.3.8-3.fc16.x86_64 php-common-5.3.8-3.fc16.x86_64
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
But it still seems strange to me that loading the php module isn't an option in httpd.conf. Thanks anyway
php should be loaded from /etc/httpd/conf.d/php.conf. I's not necessary (or shouldn't be necessary) to load it from httpd.conf itself. These lines are included in the standard httpd.conf:
# # Load config files from the config directory "/etc/httpd/conf.d". # Include conf.d/*.conf
Am 28.12.2011 16:25, schrieb Remi Collet:
Le 28/12/2011 16:10, Klaus-Peter Schrage a écrit :
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
This 2 lines should be present in /etc/httpd/conf.d/php.conf, provided by php package.
So httpd.conf doesn't have to be modified.
I know about this mechanism, but none of my php packages from Fedora gave me php.conf.
On 12/28/2011 10:04 AM, Klaus-Peter Schrage wrote:
Am 28.12.2011 16:25, schrieb Remi Collet:
Le 28/12/2011 16:10, Klaus-Peter Schrage a écrit :
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
This 2 lines should be present in /etc/httpd/conf.d/php.conf, provided by php package.
So httpd.conf doesn't have to be modified.
I know about this mechanism, but none of my php packages from Fedora gave me php.conf.
hmmm..... Perhaps something went wrong when you installed PHP
$ yum provides "*/conf.d/php.conf"
php-5.3.8-3.fc16.i686 : PHP scripting language for creating dynamic web sites Repo : fedora Matched from: Filename : /etc/httpd/conf.d/php.conf
php-5.3.8-3.fc16.i686 : PHP scripting language for creating dynamic web sites Repo : @anaconda-0 Matched from: Filename : /etc/httpd/conf.d/php.conf
On Wed, 2011-12-28 at 17:04 +0100, Klaus-Peter Schrage wrote:
Am 28.12.2011 16:25, schrieb Remi Collet:
Le 28/12/2011 16:10, Klaus-Peter Schrage a écrit :
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
This 2 lines should be present in /etc/httpd/conf.d/php.conf, provided by php package.
So httpd.conf doesn't have to be modified.
I know about this mechanism, but none of my php packages from Fedora gave me php.conf.
Not in /etc/http/conf.d/ dir?
Am 28.12.2011 17:15, schrieb Steven Stern:
On 12/28/2011 10:04 AM, Klaus-Peter Schrage wrote:
Am 28.12.2011 16:25, schrieb Remi Collet:
Le 28/12/2011 16:10, Klaus-Peter Schrage a écrit :
Have you the following SOMEWHERE in your httpd-conf-files? LoadModule php5_module "modules/libphp5.so" AddType application/x-httpd-php .php
Yes, adding those two lines did it: Now I can see the PHP Info page.
This 2 lines should be present in /etc/httpd/conf.d/php.conf, provided by php package.
So httpd.conf doesn't have to be modified.
I know about this mechanism, but none of my php packages from Fedora gave me php.conf.
hmmm..... Perhaps something went wrong when you installed PHP
$ yum provides "*/conf.d/php.conf"
php-5.3.8-3.fc16.i686 : PHP scripting language for creating dynamic web sites Repo : fedora Matched from: Filename : /etc/httpd/conf.d/php.conf
php-5.3.8-3.fc16.i686 : PHP scripting language for creating dynamic web sites Repo : @anaconda-0 Matched from: Filename : /etc/httpd/conf.d/php.conf
That's true: "rpm -ql php" gives me: /etc/httpd/conf.d/php.conf
but ls /etc/httpd/conf.d/ only shows: README welcome.conf
Something must have gone wrong, so I'd reinstall php.