Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Having problems with PHP on my LAMP stack, PHP scripts aren't being parsed. FWIW, I recently upgraded to 13.10, it used to work great before that; not positive my issues are related, seems like an easy guess though. Regardless, I just purged/re-installed apache2, php5, php5-common, and libapache2-mod-php5, but I still can't run a simple phpinfo.php script in /var/www, instead it returns the raw code as output. It does appear that the PHP module is loaded, but I'm not sure how to track it any further. Here's (hopefully) some helpful info, let me know if I left anything important out, and thanks in advance:

xyz@nanook:/var/www$ tail -n 2 /var/log/apache2/error.log 
[Fri Nov 08 23:16:39.710701 2013] [mpm_prefork:notice] [pid 2001] AH00163:
  Apache/2.4.6 (Ubuntu) PHP/5.5.3-1ubuntu2 configured -- resuming normal operations
[Fri Nov 08 23:16:39.809033 2013] [core:notice] [pid 2001] AH00094: Command 
  line: '/usr/sbin/apache2'

xyz@nanook:/var/www$ apache2ctl -S
VirtualHost configuration:
*:8000                 is a NameVirtualHost
         default server nanook (/etc/apache2/sites-enabled/000-default.conf:1)
         port 8000 namevhost nanook (/etc/apache2/sites-enabled/000-default.conf:1)
         port 8000 namevhost nanook (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used

xyz@nanook:/var/www$ apache2ctl -M | grep php
  php5_module (shared)

xyz@nanook:/var/www$ cat phpinfo.php
<?php phpinfo() ?>

xyz@nanook:/var/www$ cat /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:8000>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

xyz@nanook:/var/www$ /usr/bin/php --version
PHP 5.5.3-1ubuntu2 (cli) (built: Oct  9 2013 14:49:12) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.