[SOLVED] apache (running in Ubuntu 10.10) can't access php files
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
apache (running in Ubuntu 10.10) can't access php files
I'm having a little problem with my Ubuntu 10.10. After install LAMP, apache2 can't access php files; I can see the info from the phpinfo(); but when I create a php file in /var/www and try to access the file (via web browser), the page is blank. If I change the extension to html I can acces without problems.
I checked everythig but I can't understand why any web browser access a blank page.
Nothing appears when I'm cheking the error.log file (apache2)
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
In your httpd.conf file, locate and add index.php like this
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
DirectoryIndex index.html index.php
Also, make sure you're including
# Uncomment the following line to enable PHP (this may vary on your platform):
If you added or edited the above, stop and restart httpd (and force a reload of a web page -- in Firefox you shift and click on the reload current page icon). You may also want to put your PHP files in /var/www/htdocs for them to be found.
First of all, the phpinfo() works properly and show all the info.
I see that my httpd.conf file is empty... perhaps is not installed well or something happens...
I don't know that to do now...
I understand that "phpinfo()" worked for you. I wanted to verify whether or not "test.php" worked. And, if it did, exactly *which directory* test.php was located in.
/etc/httpd.conf determines which directories the Web server will use, and which directories can execute PHP scripts (among many other things).
But first, before we got into httpd.conf, I wanted to verify that PHP itself was working. A completely SEPARATE problem that could ALSO be causing "white space" is a simple bug in your PHP script. There are LOTS of different things that could be going wrong. So I wanted to take "baby steps" toward a solution.
Q: Could you please create "test.php", and try to execute it through your browser (as "http://localhost/test.php")?
Copy my script verbatim.
Try copying it to /var/www/htdocs/test.php (if you have that directory).
Please let us know exactly what you did, and the exact results (cut/paste error message, if possible)
Q: Exactly what OS and Apache are you running?
Q: Please run the following commands and give us the output:
ls -ld /etc/*apache*
ls -ld /etc/*httpd*
ps -eaf|grep -i apache
ps -eaf|grep -i http
- I create the file test.php and put your code above. It works, I can see the PHP info page without errors. I don't have /var/www/httpd only /var/www
- OS: Ubuntu Maverick 10.10 / Apache: Apache/2.2.16 (Ubuntu)
- Commands results:
root@pcseginf4:~# uname -a
Linux pcseginf4 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:48 UTC 2011 i686 GNU/Linux