Page 1 of 1

XAMPP can't see/handle php files

PostPosted: 12. June 2010 17:43
by Olwe
I've just installed XAMPP (XAMPP for Linux 1.7.3a) and got to all the welcome screens, phpMyAdmin just fine. I go to my /home/me/public_html/ and it sees the index.html just fine. I go to http://localhost/~me/newdir/ and it sees the index.html there and displays it fine. But when I go to a php file (http://localhost/~me/phptest.php) it gives:
Code: Select all
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Sat 12 Jun 2010 11:41:37 AM CDT
Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1


What have I done wrong? I stick the same phptest.php in the /opt/lampp/htdocs/ dir and it works....

Re: XAMPP can't see/handle php files

PostPosted: 12. June 2010 18:00
by Olwe
Correction. I'm not actually getting to my /home/me/public_html. That was the browser remembering from before. So how do I allow XAMPP to see and work with my /home/me/public_html directory?

Re: XAMPP can't see/handle php files

PostPosted: 12. June 2010 18:28
by Radzio
Uncomment loading of mod_userdir. I think it's already configured so you would only have to restart Apache then.

Re: XAMPP can't see/handle php files

PostPosted: 12. June 2010 18:32
by Olwe
Yes, but how does XAMPP know who I am? In reality, my home directory is /home/olwe/ Is the httpd.conf supposed to be told that olwe is the user? Right now User is set to nobody and Group to nogroup. Otherwise I can't imagine Apache can know what public_html we're talking about.

Re: XAMPP can't see/handle php files

PostPosted: 12. June 2010 19:07
by Radzio
mod_userdir is usually configured to allow access to /home/*/public_html as /~* where * is any name.

Re: XAMPP can't see/handle php files

PostPosted: 12. June 2010 19:39
by Olwe
mod_userdir is usually configured to allow access to /home/*/public_html as /~* where * is any name.


How can I check/trouble-shoot this? I wanted to do a command line module dump:
Code: Select all
apache2 -t -D DUMP_MODULES
, but there's no "apache2" with XAMPP, so I put this in a php file in the /opt/lampphtdocs dir:
Code: Select all
<pre>
<?php
print_r(apache_get_modules());
?>
</pre>


and yes, userdir module comes up on the list. Still, apache must need to know/resolve * to my home directory. How?

Re: XAMPP can't see/handle php files

PostPosted: 12. June 2010 19:56
by Radzio
* means any name. It will match any directory.
Uncomment the LoadModule line with mod_userdir in httpd.conf and restart Apache.
If you want to check userdir config then find a file similar to httpd-userdir.conf

Re: XAMPP can't see/handle php files

PostPosted: 12. June 2010 20:05
by Olwe
Actually, there's a line down in httpd.conf that I uncommented:
Code: Select all
# User home directories                                                                                                           
Include etc/extra/httpd-userdir.conf


Now it works!