Results 1 to 7 of 7
Hello to all,
I recently installed Apache, MySQL and PHP on Centos 5, and it seems to be installed, but then I go to the folder .../www/html and I create ...
- 12-22-2009 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 19
PHP files open blank page on browser
Hello to all,
I recently installed Apache, MySQL and PHP on Centos 5, and it seems to be installed, but then I go to the folder .../www/html and I create the usual php test file to see if is installed correctly or not.
When I open the browser and write localhost it display the apache server screen....so I assume that apache is well installed, but when I try to open the test.php file of the html folder on the browser..... localhost/test.php it display a blank page on the browser....no error, just a blank page, I read somewhere on the web that I have to change the permissions to the folder, I tried with the chmod 777, 755 to the html folder and it stills shows a blank page when I open the file, then I tried with the permission chmod 644 and then it shows an error like Apache won't have the permission to display the file.
I can't make php to work fine in the server...what can I do?


thanks for your attention and responses
regards,
Andres Camino
- 12-22-2009 #2
PHP files and their folders must all have execute permission bit set. You say you installed them, but did you configure apache to use the php plugin? You need to restart the httpd service after changing apache configuration.
- 12-22-2009 #3Just Joined!
- Join Date
- Oct 2009
- Posts
- 19
Hello coopstah13
Thanks for your response, I've restarted the httpd service but I still have teh same problem....do you have any idea why this is happening?
Thanks for your help
- 12-22-2009 #4Just Joined!
- Join Date
- Oct 2009
- Posts
- 19
I could fix the problem...but is really weird...because i had to write the change mode in the terminal for each php file like this:
# chmod 777 /var/www/html/test.php
and after that the file is shown in the browser when i hit refresh....is there any way to avoid to write that line for EACH php file I have in that folder and instead write a command like that for the whole folder? ... I tried
# chmod 777 /var/www/html
but no luck for all the files...i have to specify the file in order to watch it on the browser
any suggestions??
thanks for the responses
- 12-22-2009 #5Linux Newbie
- Join Date
- Dec 2009
- Posts
- 241
You may wanna try:
chmod 777 /var/www/html/
chmod 777 /var/www/html/*
or
chmod -R 777 /var/www/html
if I remember right ...
- 12-23-2009 #6
It's a bad idea to give anything open to the web 777 permissions unless it is really ok for it to be written to.
I think it is as simple as making sure the apache user (I think it is apache in centos) has read and execute permissions. Try the following
1. Reset the permissions to 755
2. chown apache: test.php
As I say it might not be apache but that's who it is on RHELIf we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 12-28-2009 #7Just Joined!
- Join Date
- Oct 2009
- Posts
- 19
Thank you very much for your assistance..
I tried with this line tks to zombykillah
chmod 755 /var/www/html/* (tks elija for that)
Is it usual to give permissions to the php files when you just install Apache and PHP??


Reply With Quote