0

I just recently installed an Ubuntu Server 10.10 but php doesn't seem to work. I created a file to show phpinfo() to make sure php works but it doesn't show anything. I looked for php.ini and I found three files:

/etc/php5/apache2/php.ini
/ets/php5/cgi/php.ini
/etc/php5/cli/php.ini

EDIT: Ooops! That was embarassing. I copied files from a different server and for some reason the permissions changed, this includes the test file that I use to test php. All I have to do is change the permission on all the files. SORRY about that this is a very stupid/nooby error on my part.

2
  • 1
    how are are you trying to run PHP? Apache module, fastcgi, cgi? Can you run PHP at the command line? Which web server are you using? etc etc. much more info is needed to try to diagnose this.
    – ollybee
    Apr 6, 2011 at 20:11
  • Can you paste the php file are you using for test? Apr 6, 2011 at 20:19

3 Answers 3

0

Is libapache2-mod-php5 installed? Is the module enabled? ls /etc/apache2/mods-enabled

3
  • did the ls /etc/apache2/mods-enabled and here's the result: > ls /etc/apache2/mods-enabled alias.conf alias.load auth_basic.load authn_file.load authz_default.load authz_groupfile.load authz_host.load authz_user.load autoindex.conf autoindex.load cgi.load deflate.conf deflate.load dir.conf dir.load env.load mime.conf mime.load negotiation.conf negotiation.load php5.conf php5.load reqtimeout.conf reqtimeout.load setenvif.conf setenvif.load status.conf status.load
    – eggman20
    Apr 6, 2011 at 20:20
  • try this: <?php echo phpinfo(); ?>, you may just be doing <? phpinfo() ?> and in some cases that doesn't show the info.
    – Sean C.
    Apr 6, 2011 at 21:13
  • Sean, That what exactly what my test file looks like, but it turns out that the permission on the file was not set, that's why it's not displaying anything (see edited post). That was my stupid mistake. Thanks for you help though.
    – eggman20
    Apr 6, 2011 at 21:19
0

Have you restarted apache?

sudo /etc/init.d/apache2 restart
0
0

Is the module enabled ? You need libapache2-mod-php5 and php5-common After that enable the module If apache2, apachectl -M gives you the loaded modules

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .