------------ Original Message ------------ > Date: Saturday, October 25, 2014 08:01:00 +0100 > From: Tim Streater <tim@xxxxxxxxxxxxxxxx> > To: Gergely Buday <gbuday@xxxxxxxxx> > Cc: php-general@xxxxxxxxxxxxx > Subject: Re: httpd not interpreting a php file > > On 25 Oct 2014 at 07:34, Gergely Buday <gbuday@xxxxxxxxx> wrote: > >>>> I did tests and my Apache does interpret simple php files. >>>> >>>> I copied a directory structure from a working web server and my >>>> login.php is not interpreted. Apache emits some source code >>>> from the file. >>> >>> Did you copy httpd.conf? >> >> I use the default httpd.conf as provided on centos 7 httpd >> installation, modulo >> >> ProxyPassMatch ^/(.*\.php(/.*)?)$ >> fcgi://127.0.0.1:9000/var/www/html/$1 >> DirectoryIndex /index.php >> >> What do you mean by copying? From what place to where? > > Well you said you copied a directory structure. So I assume you > are making a new installation, meaning you need to copy the > httpd.conf file too. > > 1) As asked by francis, does your httpd.conf file have a statement > like: AddType application/x-httpd-php .php > > 2) Does your httpd.conf file have a statement like: LoadModule > php5_module /usr/libexec/apache2/libphp5.so (with the appropriate > path) > > 3) Why do you not tell us your operating system and version of > apache? > > -- > Cheers -- Tim > He indicated that he is using centos-7, in which case, the httpd version should be httpd-2.4.6-18. So, ... in the /etc/httpd/conf.d directory do you have a "php.conf" file? There should be: SetHandler application/x-httpd-php AddType text/html .php lines. Are they there, uncommented? Note that the "SetHandler" is within a "<FilesMatch \.php$>" construct, so the extension on your php files matters. Additionally, do you have an /etc/httpd/conf.modules.d directory that contains the file "10-php.conf"? If so, it should have the "LoadModule php5_module modules/libphp5.so" line. By the way, where is the line: DirectoryIndex /index.php That leading "/" is not the default construct. - Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php