LAMP Problems

First off, i’m new to this forum, and i’ve tried to search for a
solution but can’t find what i’m looking for. So sorry in advance if
this has been dealt with somewhere here.

I’m trying to setup a LAMP server, and it seems to be working but still
can’t get any PHP code to display (Object not found!)

I installed LAMP using
YAST > Software Man > Filter (Patterns) -> Web and LAMP server,

then tested Apache and its working, started php with a2enmod php5,
saved the folder of the test site in /srv/www/htdocs, and it still
doesnt work.

What else am i not doing, or skipped? Any help appreciated.


d_quixote

d_quixote’s Profile: http://forums.opensuse.org/member.php?userid=21578
View this thread: http://forums.opensuse.org/showthread.php?t=406773

After enabling php5 you have to restart Apache, did you do that?

What exactly is the error message on the screen?

Are there any clues in /var/log/apache2/error_log?

Did you try a simple PHP file like this first?

Code:

<?php
phpinfo();
?>

called say phpinfo.php in the top directory of the website?


ken_yap

ken_yap’s Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=406773

Hi, thanks for the reply.

I have restarted APache after starting PHP, but still the same problem,
which is not an error message per se, my browsers just can’t open them.
And neither can Kdevelop, which gives the Object not found error - a
404. When i click on the link to the localhost, it’s running just fine.

As for the error code, this is the bit from trying to run the simple
program in the top directory.

> [Tue Feb 03 04:52:23 2009] [error] [client ::1] script
> ‘/srv/www/htdocs/test1.php’ not found or unable to stat
> [Tue Feb 03 04:53:33 2009] [notice] caught SIGTERM, shutting down
> [Tue Feb 03 04:53:37 2009] [notice] mod_python: Creating 8 session
> mutexes based on 150 max processes and 0 max threads.
> [Tue Feb 03 04:53:37 2009] [notice] mod_python: using mutex_directory
> /tmp
> [Tue Feb 03 04:53:37 2009] [notice] Apache/2.2.10 (Linux/SUSE)
> PHP/5.2.6 with Suhosin-Patch mod_python/3.3.1 Python/2.6 mod_perl/2.0.4
> Perl/v5.10.0 configured – resuming normal operations
> [Tue Feb 03 05:28:26 2009] [error] [client ::1] script
> ‘/srv/www/htdocs/test1.php’ not found or unable to stat
> [Tue Feb 03 05:36:54 2009] [error] [client ::1] script
> ‘/srv/www/htdocs/test1.php’ not found or unable to stat
>


d_quixote

d_quixote’s Profile: http://forums.opensuse.org/member.php?userid=21578
View this thread: http://forums.opensuse.org/showthread.php?t=406773

The script must be readable by the Apache webserver. Generally this
means world read permission on the files. So do this:

Code:

chmod -R o+r /srv/www/htdocs

If you have any subdirectories, they should have both read and search
permissions, so do this:

Code:

find /srv/www/htdocs -type d -print0 | xargs -0 chmod o+rx

That’s a minus-zero, not minus-capital-O


ken_yap

ken_yap’s Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=406773

Thanks again,

unfortunately that doesn’t seem to work either. Same error message:

> [Tue Feb 03 05:59:27 2009] [notice] caught SIGTERM, shutting down
> [Tue Feb 03 05:59:28 2009] [notice] mod_python: Creating 8 session
> mutexes based on 150 max processes and 0 max threads.
> [Tue Feb 03 05:59:28 2009] [notice] mod_python: using mutex_directory
> /tmp
> [Tue Feb 03 05:59:28 2009] [notice] Apache/2.2.10 (Linux/SUSE)
> PHP/5.2.6 with Suhosin-Patch mod_python/3.3.1 Python/2.6 mod_perl/2.0.4
> Perl/v5.10.0 configured – resuming normal operations
> [Tue Feb 03 06:04:23 2009] [error] [client ::1] script
> ‘/srv/www/htdocs/test1.php’ not found or unable to stat
> [Tue Feb 03 06:04:37 2009] [error] [client ::1] script
> ‘/srv/www/htdocs/test1.php’ not found or unable to stat
> [Tue Feb 03 06:09:49 2009] [error] [client ::1] script
> ‘/srv/www/htdocs/test1.php’ not found or unable to stat
>


d_quixote

d_quixote’s Profile: http://forums.opensuse.org/member.php?userid=21578
View this thread: http://forums.opensuse.org/showthread.php?t=406773

Is /srv a separate filesystem perhaps mounted with different options?

Also all directories from / must be searchable.

/ must be 755
/srv must be 755
/srv/www must be 755
/srv/www/htdocs must be 755

755 = rwxr-xr-x


ken_yap

ken_yap’s Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=406773

BTW, that log shows something I hadn’t noticed before, that the web
browser is trying to use IPv6 for the connection and while Apache is
capable of it, the permissions do not allow access to the IPv6
localhost. This is due to the line

Code:

::1 localhost

in /etc/hosts. Comment that out, and that should improve things.

The other way is to Allow ::1 in the Apache config. IPv6 for browsing
actually does work, but your app may not be ready for it.


ken_yap

ken_yap’s Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=406773

Thank again,

Hehe, what i managed to do is break the system.

I used

> chmod -R 755 /

Even to me that looks wrong!

And i’ve locked myself out of the system. I can only log in as ‘root’.
I tried what i thought would un-do the damage

>
> chmod -R 770 /

but it doesn’t work.

when i try to login using my username it gives me pop ups that say:

> Cannot enter home directory using /

and then,

> Please look at KDMs logfile(s) for more info or contact system admin …

Now i’m scared i’ll break root too. And really not looking to my Xth
reinstall in a month!

Maybe i should post this problem in another topic?


d_quixote

d_quixote’s Profile: http://forums.opensuse.org/member.php?userid=21578
View this thread: http://forums.opensuse.org/showthread.php?t=406773

Yes, unfortunately you have broken your system. You were only meant to
chmod each directory on the path, not everything underneath with -R.

Sorry to tell you this bad news, but you’ll have to reinstall.


ken_yap

ken_yap’s Profile: http://forums.opensuse.org/member.php?userid=221
View this thread: http://forums.opensuse.org/showthread.php?t=406773

Ouch!

I will do that and try LAMP again. Will post how it goes.


d_quixote

d_quixote’s Profile: http://forums.opensuse.org/member.php?userid=21578
View this thread: http://forums.opensuse.org/showthread.php?t=406773

LAMP up and running - only thing that needs to be fixed is phpMyAdmin
now.

I followed this to the T:

> ‘Linux Apache MySQL PHP Server (lamp) - openSUSE’
> (http://en.opensuse.org/LAMP_for_OpenSuSE_11)

YAST really simplifies thinggs! I must have really messed up my system
before i even installed LAMP to have messed it up like that.

Thanks for all the help, ken_yap :slight_smile:


d_quixote

d_quixote’s Profile: http://forums.opensuse.org/member.php?userid=21578
View this thread: http://forums.opensuse.org/showthread.php?t=406773