Enabling PHP

KnightB4

New Member
Could be a newbie question, but I have not found the solution anywhere.

I have a brand new VPS, everything seems to be set up correctly but when I try to use php (either phpinfo() or any echo statement), nothing happens.
I have done a fair amount of reading, I have played with the options in the WHM "Configure Suexec and PHP" screen, but nothing happens.
(I am running Apache 2.x and PHP 5.x).

Did you need to do anything to enable PHP when you got your VPS?

Thanks for your help.
Louis
 
Louis,

PHP is installed / enabled by default.
What do you see while trying to access php page? Blank screen, error, attempt to download code or something else? If there anything in Apache log file at /usr/local/apache/logs/error_log?

Regards,
Paul
 
Hi Paul,

Nothing between the php tags gets displayed. The HTML before the PHP tags is displayed. The same code runs fine on my local server:
<?php
echo "php is here";
phpinfo();
?>

error_log doesn't show anything when I access that page
error_log shows "PHP/5.2.5 configured" each time I try to tweak php/suexec setup.

I may be doing something stupid but I cannot figure it out.

Louis
 
Louis,

Do you have a .htaccess file in any directory up to the directory where your php file is located?
 
No, this is just a stupid test file:

toto
<?php
echo "php is here";
phpinfo();
?>
nothing else after this


It prints first and last line, but nothing in between.
Louis
 
Louis,

Thanks for your PM. Try to rename the file from index.html to index.php.
 
All right, this is it. Renaming it did the trick. Thanks a lot!

I thought Apache didn't care: .html, .php or anything.
Is there a configuration somewhere for that?

Louis
 
I read somewhere that you do not have to save your PHP files as .php

This may be correct for stand-alone/CLI php, but not on a web server?

Louis
 
Amen, that's where I got confused.

Also, you can name your php include files whatever you want. That added to my confusion.

Anyway, I'll remember that now!
Thanks,
Louis
 
Top