lampp install - public_html directory not working

I have followed the How-to on the lampp install. Everything works up til the point where I am supposed to make a “index.php” file in /home/USERNAME/public_html:

*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*

according to the How-to this is the time to ask for help in the forum so here I am:)

I assume that PHP is installed correctly and that this is a case of softlinking. So How do I softlink from /srv/www/htdocs to /home/USERNAME/public_html?

You don’t say what URL you used. It should be:

http://your.server/~username/index.php

No linking required, it should just work. Provided you have the PHP module installed in Apache and activated.

servername loacalhost Apache works.
The problem is that the index.html in /srv/www/htdocs/ works but the index php in my /home/USERNAME/public_html
Produces an error.

So this does not just work. It seems that you are right: PHP is not running.
When putting PHP fils in /srv/www/htdocs/test.php I get the same error.

http://localhost/test.php

*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
Wed Mar 25 16:26:27 2009
Apache/2.2.10 (Linux/SUSE) *

Look in /var/log/apache2/error_log for more clues about the 404 error, in particular the parh of the filename it tried to fetch. Also did you make sure that index.php has world read permissions?

[error] [client 127.0.0.1] File does not exist: /srv/www/htdocs/USER

The file does exist but there is no PHP active to read it - so it seems.

(Strange since I used the lamp pattern where the P is supposed to be PHP -isn’t it?)

here is the part that does not compute:

Did you remember to put a tilde (~) before the username?

???:sarcastic:

Why should I?

Just to learn something and to see if it is mee I installed Ubuntu and followed this How-to

http://www.howtoforge.com/ubuntu_debian_lamp_server

It was up in 10 minutes whith php mysql and phpmyadmin.

Just to show the importance of good documentation (in the suse howto some links are broken! And even if it probably is going to work in the end - there is a difference between 10 minutes and hours/days).

I think Suse has done some serious and good work with 11.1 so I hope it is only me and my laptop that disagrees with the lamp installation. The How-to just does not work for me! Is there any other - up to date -information that I have missed?

Because notation matters.

http://www.example.org/~user/index.html maps to /home/user/public_html/index.html

http://www.example.org/user/index.html maps to /srv/www/htdocs/user/index.html

Quite a difference. If you don’t pay attention to the details, then don’t be surprised if something bites you. >:)

Ok that was realy the answer to my first question (I call it softlinking you call it mapping) - Thanks! :shame:

(You are right it does matter - and you have brilliantly explained why).

Now I am only left with the problem that PHP is not running.
I will make a fresh install and try again.

It’s not softlinking because the mapping is done inside the web server and no symbolic links are involved.

Yep got it!

Now do you have any suggestion to how I can make PHP run without trying the reinstall?
It seems that the lamp pattern does not pull all the required files?
I have tried uninstalling it - and removing the PHP folders and then reinstalling it. PHP will not run.

Things to check:

Apache PHP module installed?

rpm -q apache2-mod_php5

PHP module enabled? See output of:

/usr/sbin/httpd2 -M

If not, add php5 to the list APACHE_MODULES in /etc/sysconfig/apache2, then restart apache with /etc/init.d/apache2 restart.

Next try a simple PHP file:

<?php
phpinfo();
?>

Put this in /srv/www/htdocs/test.php and go to http://localhost/test.php. You should get a lot of PHP config info. If not, report back.

If not, add php5 to the list APACHE_MODULES in /etc/sysconfig/apache2, then restart apache with /etc/init.d/apache2 restart.

Eureka that was it!rotfl!

Thanks for all the help.

Excellent, have a lot of fun.