LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-10-2009, 09:01 AM   #1
elfinkind
LQ Newbie
 
Registered: Sep 2009
Location: Northeastern US
Distribution: Arch, Debian, Kolibri
Posts: 22

Rep: Reputation: 19
can't figure out how to get php to work in slack 12.2


I recently made the move to Linux from windoze, with a short trip with Ubuntu. When that failed through my own stupidity and a broken down CD drive, I installed Slackware 12.2.

Now, I want to start learning php scripting, and have Apache 2 installed, as well as php5 and mysql. For some reason, apache isn't recognizing and/or executing even simple php scripts.

My php appears to be running, as does apache, and I can't for the life of me find anyone who has asked this question in any forum, so I started this. If someone knows of another thread where I can find info, please don't hesitate to correct me. I'm not afraid to admit that (a), I don't know what I'm doing, yet, and (b), I might be wrong about something/anything.

Thanks for any help!
 
Old 09-10-2009, 09:11 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
At a minimum, you have to edit "/etc/httpd/httpd.conf" and uncomment the PHP include line that is almost at the bottom:
Code:
# Uncomment the following line to enable PHP:
#
Include /etc/httpd/mod_php.conf
Then, restart Apache (or reboot).

Eric
 
Old 09-10-2009, 10:15 AM   #3
elfinkind
LQ Newbie
 
Registered: Sep 2009
Location: Northeastern US
Distribution: Arch, Debian, Kolibri
Posts: 22

Original Poster
Rep: Reputation: 19
Ok, I found that and uncommented it. I restarted the computer, and still can't get a simple script to work. I run my index.php file, which is designed simply to display information about my php install, from localhost and it won't do anything. I get no error, but no display, either. Am I being dense? Wouldn't surprise me...

Last edited by elfinkind; 09-10-2009 at 10:20 AM.
 
Old 09-10-2009, 10:32 AM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Well you can run
Code:
php -f /path/to/file/on/server.php
from the terminal and make sure PHP is parsing properly. If it works there then there is something screwed up within the webserver.
 
Old 09-10-2009, 10:35 AM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Oh, also check your /etc/httpd/mod_php.conf file and make sure that first, it is loading the module and second that it is set to parse .php files. So you should have these two lines in there (there are a lot of comments in that file, so just look for these two lines separately).

Code:
LoadModule php5_module lib/httpd/modules/libphp5.so

AddType application/x-httpd-php .php
 
Old 09-10-2009, 10:56 AM   #6
elfinkind
LQ Newbie
 
Registered: Sep 2009
Location: Northeastern US
Distribution: Arch, Debian, Kolibri
Posts: 22

Original Poster
Rep: Reputation: 19
That's all good, so I cleared the cache in my browser and tried again to go to localhost. It appears that my apache is not running. I checked it in package manager; it is definitely installed.

How would I get apache to run?
 
Old 09-10-2009, 10:58 AM   #7
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Make sure that /etc/rc.d/rc.httpd is executable and it will do it on boot, then just run it with the start parameter.

Code:
/etc/rc.d/rc.httpd start
 
Old 09-10-2009, 11:01 AM   #8
elfinkind
LQ Newbie
 
Registered: Sep 2009
Location: Northeastern US
Distribution: Arch, Debian, Kolibri
Posts: 22

Original Poster
Rep: Reputation: 19
/etc/rc.d/rc.httpd start

returned the following:

httpd: Syntax error on line 117 of /etc/httpd/httpd.conf: Cannot load /usr/php5apache2.so into server: /usr/php5apache2.so: cannot open shared object file: No such file or directory

Does this help?
 
Old 09-10-2009, 11:04 AM   #9
elfinkind
LQ Newbie
 
Registered: Sep 2009
Location: Northeastern US
Distribution: Arch, Debian, Kolibri
Posts: 22

Original Poster
Rep: Reputation: 19
Just checked that file, found the command in there to make it executable, ran that through terminal, will quick restart my machine. Back in a flash...
 
Old 09-10-2009, 11:05 AM   #10
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Sounds like a typo somewhere. There should never be any *.so files in the /usr directory. They should be under some lib directory, whether /usr/lib or /lib.

I am running 12.1 and I do not have that file at all. So I would suggest running
Code:
locate php5apache2.so
and it should tell you where it is located, then just adjust that in the conf file.
 
Old 09-10-2009, 11:09 AM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
And to get this running you shouldn't need to restart your computer, because when you start it up, all it does is run that same file with the start command. If it doesn't work when you do it manually, it won't work on boot.
 
Old 09-10-2009, 11:19 AM   #12
elfinkind
LQ Newbie
 
Registered: Sep 2009
Location: Northeastern US
Distribution: Arch, Debian, Kolibri
Posts: 22

Original Poster
Rep: Reputation: 19
Ok, typed locate php5apache2.so in terminal, returned nothing. Hmmm, seems that might be the problem, but I don't understand how I can have apache and php both installed and not have that file.

Next?

And I can't tell you how much I appreciate your help!
 
Old 09-10-2009, 11:29 AM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Well, on my system my php module is called libphp5.so (and I am not so sure they would've changed the naming scheme).

If you do a locate on that, and it is there, then you will either need to modify your httpd.conf or your mod_php.conf files both in the /etc/httpd/ directory (depending on how that module is called). I am wondering if somehow the conf go screwed up somehow, whether like a sticky backspace/del key (happens occasionally with my laptop).
 
Old 09-10-2009, 11:32 AM   #14
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
Ok, typed locate php5apache2.so in terminal, returned nothing. Hmmm, seems that might be the problem, but I don't understand how I can have apache and php both installed and not have that file.
This is because there's no such file in a standard installation. This is the relevant line from /etc/httpd/mod_php.conf :
Code:
LoadModule php5_module lib/httpd/modules/libphp5.so
The module is called libphp5.so. I think you have a typo or two. This is the standard naming convention in Slackware 13.
 
Old 09-10-2009, 12:05 PM   #15
elfinkind
LQ Newbie
 
Registered: Sep 2009
Location: Northeastern US
Distribution: Arch, Debian, Kolibri
Posts: 22

Original Poster
Rep: Reputation: 19
I'm using Slackware 12.2, not 13...

Checked the mod_php file, that line is correctly typed out:

LoadModule php5_module lib/httpd/modules/libphp5.so

still can't get apache to run.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't figure out how to choose correct kernel (Slack 12.2) hippiejake Slackware 2 08-29-2009 02:46 PM
how to figure out errors in apache+php? jean2e Linux - Server 9 07-13-2009 01:19 AM
Newbie: Can't figure out dependencies list for superkaramba on Slack 12. waco-old-paco Slackware 7 11-30-2007 11:52 AM
cant figure my wireless out - Slack 10.1 [LAG] Prude Slackware 2 03-27-2005 03:07 PM
Cant Figure out how to install ma401 in Slack 9.1? im linux newb! metaphys Linux - Wireless Networking 8 07-27-2004 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration