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.

EEAA
  • 109,363
  • 18
  • 175
  • 245
eggman20
  • 13
  • 5
  • 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 06 '11 at 20:11
  • Can you paste the php file are you using for test? – Mircea Vutcovici Apr 06 '11 at 20:19

3 Answers3

0

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

Sean C.
  • 954
  • 5
  • 7
  • 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 06 '11 at 20:20
  • try this: , you may just be doing phpinfo() ?> and in some cases that doesn't show the info. – Sean C. Apr 06 '11 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 06 '11 at 21:19
0

Have you restarted apache?

sudo /etc/init.d/apache2 restart
Bourne
  • 1,039
  • 5
  • 18
  • 24
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

thms0
  • 71
  • 9