Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
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 '11 at 20:11
    
Can you paste the php file are you using for test? –  Mircea Vutcovici Apr 6 '11 at 20:19
add comment

2 Answers 2

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

share|improve this answer
    
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 '11 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 '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 6 '11 at 21:19
add comment

Have you restarted apache?

sudo /etc/init.d/apache2 restart
share|improve this answer
    
yes, I I did it a couple of times. THanks –  eggman20 Apr 6 '11 at 20:17
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.