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 01-24-2004, 03:30 PM   #1
Greg21
Member
 
Registered: Jan 2002
Posts: 72

Rep: Reputation: 15
php with apache after full install


I just finished a full default install of slackware 9.1. The apache works right out of the box. I got mysql workiny by following the instructions on their website. I can't get php working. I tried uncommenting out the files at the end of the httpd.conf file. I also tried adding the lines directly to the httpd.conf file. Nothing works. What am i missing, what do I need to do to get php working with apache? Do I need to compile php from source (its installed by a package during the slack install right now) ?

Help and thanks

Greg
 
Old 01-24-2004, 04:09 PM   #2
nesware
Member
 
Registered: Jan 2004
Location: belgium
Distribution: Slackware
Posts: 117

Rep: Reputation: 15
alright... it works with me out of the box, so it should work for you..
make sure the files are called .php and make sure they are executable
chmod +x file.php
check in the conf files in /etc/apache if the configuration is not completely different than your previous distro or maybe the php package wasn't installed correctly... re-download them and reinstall them...
or give us some more info on error message and such
 
Old 01-24-2004, 04:21 PM   #3
Greg21
Member
 
Registered: Jan 2002
Posts: 72

Original Poster
Rep: Reputation: 15
root@bert:/var/www# apachectl start
[Sat Jan 24 17:17:27 2004] [warn] module mod_php4.c is already added, skipping
[Sat Jan 24 17:17:27 2004] [warn] module mod_ssl.c is already added, skipping
/usr/sbin/apachectl start: httpd started


and the end of my httpd.conf file looks like:

# ==> 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

# ==> mod_ssl configuration settings <==
#
# PACKAGES REQUIRED: apache (N series) and openssl (N series)
#
Include /etc/apache/mod_ssl.conf



---

When I try and load php files after starting the server that way I only get blank pages.

I am trying to load a page containing <?php php_info(); ?> and one with <?php echo "test.."; ?>

If I can supply any other infromation let me know and I will.

Greg

Last edited by Greg21; 01-24-2004 at 04:28 PM.
 
Old 01-24-2004, 06:58 PM   #4
CartersAdvocate
Member
 
Registered: Sep 2003
Location: Columbus, OH
Distribution: Slackware 12.2
Posts: 166

Rep: Reputation: 30
Did you make sure they are executable like nesware said?
 
Old 01-24-2004, 07:09 PM   #5
nesware
Member
 
Registered: Jan 2004
Location: belgium
Distribution: Slackware
Posts: 117

Rep: Reputation: 15
Quote:
I am trying to load a page containing <?php php_info(); ?> and one with <?php echo "test.."; ?>

If I can supply any other infromation let me know and I will.

Greg [/B]
yeah.. what's your hostname, what's your hostname in httpd.conf
what url do you use in what browser and what does it show?
 
Old 01-24-2004, 10:31 PM   #6
Greg21
Member
 
Registered: Jan 2002
Posts: 72

Original Poster
Rep: Reputation: 15
The webserver works fine. I can view .html pages fine through it. For some reason php wont work.

I access it via localhost, though it also works by ip from other computers.

Greg

Last edited by Greg21; 01-24-2004 at 10:48 PM.
 
Old 01-24-2004, 11:28 PM   #7
Greg21
Member
 
Registered: Jan 2002
Posts: 72

Original Poster
Rep: Reputation: 15
Got it. Not sure how, but I did.
 
Old 02-28-2004, 11:57 PM   #8
bulzbb
Member
 
Registered: Feb 2004
Posts: 50

Rep: Reputation: 15
Hi Greg21,

I am having exactly the same problem as what you faced. You really dont know what you did to make it work? If you do, can you please tell me? Thanks.
 
Old 02-29-2004, 12:02 AM   #9
bulzbb
Member
 
Registered: Feb 2004
Posts: 50

Rep: Reputation: 15
Nevermind my earlier post. I somehow got it working too, after struggling for the last few hours. All I did is restarting the daemons (#apachectl restart) after editing the httpd.conf (note: restarting the box itself wont fix the problem).

Cheers.
 
Old 02-29-2004, 10:11 PM   #10
Ninja_212
Member
 
Registered: Sep 2003
Location: Indonesia
Distribution: Mandrake,RedHat,Slackware
Posts: 58

Rep: Reputation: 15
Can i know what have you editted in your httpd.conf file cause i'm also cant get php work even if i restarted the apache server. Thanks
 
Old 02-29-2004, 10:15 PM   #11
bulzbb
Member
 
Registered: Feb 2004
Posts: 50

Rep: Reputation: 15
Just uncomment this line (which located almost at the end of the last page):

Include /etc/apache/mod_php.conf

Cheers
 
Old 02-29-2004, 10:40 PM   #12
Ninja_212
Member
 
Registered: Sep 2003
Location: Indonesia
Distribution: Mandrake,RedHat,Slackware
Posts: 58

Rep: Reputation: 15
I've done that before but it gives me a message

module mod_php is already added

and it still gives me blank page anytime i try to load a .php file... do you have any suggestion. thanks
 
Old 02-29-2004, 10:44 PM   #13
bulzbb
Member
 
Registered: Feb 2004
Posts: 50

Rep: Reputation: 15
Yes, it will say that, because in /etc/apache/mod_php.conf, there is this line:

AddModule mod_php4.c

Now, that module has been added somewhere. Thus the message you receive. Once you uncommented that line, you have to restart apache by typing (as root):

/usr/sbin/apacectl restart

It should work then.

Cheers.
 
Old 09-08-2004, 03:04 AM   #14
kaN5300
LQ Newbie
 
Registered: Sep 2004
Location: Russia
Distribution: Slackware linux 10
Posts: 27

Rep: Reputation: 15
Greetings! I have slackware linux 10 distrib, and i also have sm trublz in setting up a phpbb2 forum. Thats what in 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

# ==> mod_ssl configuration settings <==
#
# PACKAGES REQUIRED:  apache (N series) and openssl (N series)
#
Include /etc/apache/mod_ssl.conf
Thats what in mod_php.conf
Code:
#
# mod_php - PHP Hypertext Preprocessor module
#

# Load the PHP module:
LoadModule php4_module libexec/apache/libphp4.so

# 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
Thats what apache says after apachectl restart
Code:
root@portal:/etc/apache# apachectl restart
/usr/sbin/apachectl restart: httpd restarted
root@portal:/etc/apache#
Thats what in error log
Code:
[Wed Sep  8 11:59:45 2004] [notice] SIGHUP received.  Attempting to restart
[Wed Sep  8 11:59:46 2004] [notice] Apache/1.3.31 (Unix) PHP/4.3.7 configured -- resuming normal operations
[Wed Sep  8 11:59:46 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)
When i try 2 load test.php file via apche, that contains of this
Code:
<?
phpinfo();
?>
its ok, it says all info about my php, but when i try to run sm file from forum phpbb2, it fails, i can only see a source php code in my browser.

Ohh, sorry, while i were typing this, my problem fixed I tryed to run the php script with a clock with such params:
Code:
-rwxr-xr-x  1 nobody nobody 17982 1999-03-01 08:57 COPYING*
-rwxr-xr-x  1 nobody nobody  3085 2000-08-03 20:03 LISEZMOI*
-rwxr-xr-x  1 nobody nobody  2792 2000-08-02 22:33 README*
drwxr-xr-x  2 nobody nobody  4096 2000-03-04 13:47 digits/
-rwxr-xr-x  1 nobody nobody  1905 2000-08-02 22:33 digits_clock.php*
Digits_clock.php is working fine
 
Old 09-08-2004, 03:59 AM   #15
Obscure
Member
 
Registered: Apr 2003
Location: Milan
Distribution: Slackware 10 / FreeBSD 5.3
Posts: 175

Rep: Reputation: 32
Angry Problem PHP

HI all!

I'm tring to make php+apache working on my Slack 10! I've installed all as packages!
MySQL is installed too!

Apache is working ok and PHP code is processed!!

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

# ==> mod_ssl configuration settings <==
#
# PACKAGES REQUIRED: apache (N series) and openssl (N series)
#
Include /etc/apache/mod_ssl.conf
If I try to uncomment last line (Include /etc/apache/mod_ssl.conf) Apache doesn't start 'cause can't find mod_ssl.conf!!!! SSL is installed but I have no mod_ssl.conf file....why????where is it???

Uncommenting only mod_php.conf Apache starts correctly and PHP code is executed

Should you help me please????

Last edited by Obscure; 09-08-2004 at 04:11 AM.
 
  


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
install php --with-apache tunedLow Linux - Software 1 07-13-2004 08:30 AM
Integrating PHP and MySQL Into Apache From Full Installation tsuehpsyde Fedora 11 05-05-2004 02:15 PM
Apache-PHP install failure f11235813 Linux - Software 0 02-24-2004 10:34 PM
PHP 4.3.4 + Apache 2.0.48 won't install linux-addict Linux - Software 1 01-17-2004 08:47 PM
new apache-php install j-ray Linux - Software 1 04-01-2002 07:33 AM

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

All times are GMT -5. The time now is 08:23 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