On Mon, Nov 23, 2009 at 11:59 PM, David C. Rankin <drankinatty@xxxxxxxxxxxxxxxxxx> wrote: > Guys, > > I can't believe this. On my new arch install on my laptop, I'm finally getting > around to configuring the web server and I am having trouble with php. When I > try and access a php page, all I get is the text of the script echoed to the > browser. I have heard about this happening before and I think I have even > fixed it before, but I can't for the life of me remember how? I've been > through the wiki at: > > http://wiki.archlinux.org/index.php/LAMP > > I have the following loaded: > > php 5.3.1-2 > php-apache 5.3.1-2 > php-curl 5.3.1-2 > php-docs 5.3.0-1 > php-enchant 5.3.1-2 > php-gd 5.3.1-2 > php-gmp 5.3.1-2 > php-intl 5.3.1-2 > php-ldap 5.3.1-2 > php-mcrypt 5.3.1-2 > php-odbc 5.3.1-2 > php-pear 5.3.1-2 > php-pgsql 5.3.1-2 > php-pspell 5.3.1-2 > php-snmp 5.3.1-2 > php-sqlite 5.3.1-2 > php-tidy 5.3.1-2 > php-xsl 5.3.1-2 > > My php config in httpd.conf is: > > LoadModule php5_module modules/libphp5.so > DirectoryIndex index.php index.html index.htm > Include conf/extra/php5_module.conf > > I've configured php and php works from the command line just fine and will > dump phpinfo() to a terminal, but from my browser pointed at: > > http://localhost/dcr/phpinfo.php > > all I get is: "<?php phpinfo(); ?>" (no quotes) which is nothing more than > the content of my test script. I have also configured php.ini with the proper: > > open_basedir =.:/srv/http:/usr/share/pear:/home:/tmp:/var/lib/egroupware > <snip> > > include_path = > ".:/srv/http/secure:/srv/http/htdocs:/srv/http/dl:/usr/share/pear:/srv/http" > > to accomadate the php include and defined the directory to /dcr. In fact I can > browse /dcr just fine, but clicking on the phpinfo() script just returns the > text of the script like all my other pages. > > What's the trick? > > (yes, I've stopped and restarted httpd...) The only thing I can think of is that you've placed the Include line before the other LoadModule directives. If you look at /etc/httpd/conf/extra/php5_module.conf, it checks if mod_dir (and mod_php) is loaded before applying its directives.