LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-02-2003, 07:16 PM   #1
miketheninja
LQ Newbie
 
Registered: Oct 2003
Posts: 5

Rep: Reputation: 0
PHP and Apache help


I just installed the PHP package from Slackware.com. Whenever I try and run a php script now though, instead of having the server parse them, it asks me where should I save the php file. any ideas?
 
Old 10-02-2003, 07:39 PM   #2
elgonzo
LQ Newbie
 
Registered: Oct 2003
Location: Germany, Munich
Distribution: Redhat9
Posts: 2

Rep: Reputation: 0
your apache must know, what to do with the filesuffix .php

try adding
AddType application/x-httpd-php .php (assuming you have apache 1.3.x)

to your http.conf
 
Old 10-02-2003, 07:43 PM   #3
xdrainox
LQ Newbie
 
Registered: Aug 2003
Posts: 16

Rep: Reputation: 1
added that line and saved.. no worky here.. restarted apache, no go.
 
Old 10-02-2003, 08:12 PM   #4
Astro
Member
 
Registered: Jan 2003
Location: Ballston Lake, NY
Distribution: Slackware, Debian
Posts: 665

Rep: Reputation: 30
Try this whole line instead...

AddType application/x-httpd-php .php4 .php3 .phtml .php

Just in case... humor me here..

Other than that, might I reccomend installing from source? I've never had a problem installing like that.
 
Old 10-02-2003, 08:46 PM   #5
boolim
Member
 
Registered: Aug 2003
Distribution: Slackware
Posts: 32

Rep: Reputation: 15
i had the similar problems last time with my apache 2.0....
What browser do u use? i remember this prob happened only in opera, and fine in konquerer and mozilla......
but after restarting for several times, it finally works.... lol, that's something unexplainable in computing...
 
Old 10-02-2003, 08:48 PM   #6
xdrainox
LQ Newbie
 
Registered: Aug 2003
Posts: 16

Rep: Reputation: 1
I don't think the addtype application thing is it. I don't know what version of Slack he's running but I'm running 9.1.. I have the mod_php.conf with the Addtype Application stuff in that.. it seems to load, because when I told it to load mod_php it said there was a dupe and it wasn't going to load it.. so. I'm lost right now. still googling for it, but if you know of anything else to try post it here please! =)

and I dont think its a browser issue.. running IE.

-Draino

Last edited by xdrainox; 10-02-2003 at 08:50 PM.
 
Old 10-03-2003, 01:21 AM   #7
QtCoder
Member
 
Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Rep: Reputation: 15
I had the same problem today.

I installed Slackware for the first time ever (9.1), and Apache wouldn't parse PHP scripts. So here's what I did to remedy my situation:

-- removepkg apache; removepkg php
-- downloaded the apache and php sources
-- compiled apache first, being sure to select mod_php while running ./configure
-- compiled php
-- installed with checkinstall (rather than 'make install')

After that, a little conf file tweaking had me up and running. One tweak did include setting the AddType directive.

Anyway, the point I'm getting to here is, if all else fails, compile the sources. :-)

(I know I didn't answer your actual question. I'm just putting in my two cents.)

Last edited by QtCoder; 10-03-2003 at 01:25 AM.
 
Old 10-03-2003, 05:07 AM   #8
melquiades
Member
 
Registered: Jul 2003
Location: Northern Scotland
Distribution: Slackware 9.1
Posts: 48

Rep: Reputation: 15
I just did a clean install of slack 9.0 and had the problem to start with, everything is setup by default ok, you don't need to add mod_php on it own, all you need to do is scroll to the very bottom of /etc/apache/httpd.conf and un-commment the install line (sorry can't remember the exact syntax- at a windows box right now) but then PHP is added as a DSO and everything should work ok

also remember to add index.php to the DirectoryIndex section of your httpd.conf in order to see default php scripts in a directory

in my case I didn't have to do anything else to get PHP running perfectly - also GD is compiled as part of it so all the lovely image functiosn are there without any hassle too

hope it helps

Mlqds

Last edited by melquiades; 10-03-2003 at 05:09 AM.
 
Old 10-03-2003, 08:25 AM   #9
xdrainox
LQ Newbie
 
Registered: Aug 2003
Posts: 16

Rep: Reputation: 1
You know what was weird, I uncommented that line at the bottom and when I restarted Apache it was giving me errors about it already being loaded ( that was the first thing I tried ).. So I didn't think that was the problem.. I tried it again later and did not recieve the errors. Working now. Thanks!

-Josh
 
Old 10-03-2003, 09:25 AM   #10
melquiades
Member
 
Registered: Jul 2003
Location: Northern Scotland
Distribution: Slackware 9.1
Posts: 48

Rep: Reputation: 15
if it does start giving you the error about being loaded twice then you need to comment out the lines in the mod_php file that is telling PHP to load, thus it being told to load twice. the install module line in httpd.conf will take care of everything, so just # out the line in (I think the file is) mod_php.conf
again sorry for not specific detilas but still on a windows box. anyway the file to comment out the line is real short, about 10 lines, ah hell you'll be able to figure it out - glad it worked
 
Old 10-03-2003, 11:47 AM   #11
brittbs
LQ Newbie
 
Registered: Oct 2003
Location: Lexington
Distribution: Slackware
Posts: 3

Rep: Reputation: 0
I am also experiencing this same problem.

Including the line:
Include /etc/apache/mod_php.conf
in httpd.conf

causes httpd to report this apon restarting:
[Fri Oct 3 12:40:23 2003] [warn] module mod_php4.c is already
added, skipping

although it is not added anywhere that I can see (definitely not added in httpd.conf, which would be the logical place with all the other modules).

lynx http://localhost -dump -head | grep Server reports:
Server: Apache/1.3.27 (Unix) PHP/4.3.1

I will mess with it further when I get back ... have to run out for a few now. I'd like to find a solution that doesn't include removing PHP and Apache packages and reinstalling.
 
Old 10-04-2003, 03:33 AM   #12
melquiades
Member
 
Registered: Jul 2003
Location: Northern Scotland
Distribution: Slackware 9.1
Posts: 48

Rep: Reputation: 15
its beyond me why this works looking at it rationally but this is all I did to a default installation of slack 9.0 in order to get it running

this is the end of my httpd.conf
Code:
# ==> mod_php configuration settings <==
#
# PACKAGES REQUIRED:  openssl-solibs (A series) and/or openssl (N series),
#                     mysql (AP series), gmp (L series), and apache (N series)
#
Include /etc/apache/mod_php.conf
and this is the entire contents of my mod_php.conf
Code:
#
# mod_php - PHP Hypertext Preprocessor module
#

LoadModule php4_module libexec/libphp4.so
#AddModule mod_php4.c

# Tell Apache to feed all *.php files through the PHP module
AddType application/x-httpd-php .php

# This will display PHP files in colored syntax form.  Use with caution.
#AddType application/x-httpd-php-source .phps
as you can see the include line tells apache to load mod_php.conf - then mod_php.conf tells apache to 'AddType...' but the line to add module needs to be commented out else you get a double loading error - why? I have no idea, this is just what I've found on my system - I'm pretty new to all this so I hope this helps you out
 
Old 10-04-2003, 01:25 PM   #13
brittbs
LQ Newbie
 
Registered: Oct 2003
Location: Lexington
Distribution: Slackware
Posts: 3

Rep: Reputation: 0
wow melquiades,

That worked for me sofar it seems. Thats extremely odd since I tried adding everything except:

AddType application/x-httpd-php .php

to httpd.conf previously. I'd like to look further into this to see why this fix worked.
 
Old 10-05-2003, 07:29 AM   #14
melquiades
Member
 
Registered: Jul 2003
Location: Northern Scotland
Distribution: Slackware 9.1
Posts: 48

Rep: Reputation: 15
tell me about it! see what I mean, it doesn't seem to make any sense at all? if you find anything out please pop a quick note in here coz I'd love to know also

ps - happy to hear it worked

later
mlqds
 
  


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
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
slackware, apache and PHP from .tgz - problems with PHP szymon Slackware 2 09-06-2004 04:57 PM
reinstalled apache, php, still no php support SuSE 8.2 hindenbergbaby Linux - Software 1 10-14-2003 01:42 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 06:23 AM

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

All times are GMT -5. The time now is 03:29 AM.

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