LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-27-2007, 06:23 PM   #1
Ramonvel
LQ Newbie
 
Registered: Aug 2007
Posts: 19

Rep: Reputation: 0
Help installing PHP 5 with other modules


Hi Guys,

I have Slackware 12 on this machine with recompiled httpd-2.2.4. I had installed PHP 5.2.5, but everytime I go to index.php, it displays the code instead of the page.

I need to know if there are any dependencies or something else missing. In RedHat there is a command :" rpm -qa | grep php ", but I don't know how to do it here.

In addition, I need the following requirements:

# PHP 5
# PHP PEAR 5 including DB, Mail and Mail_Mime
# PECL FileInfo
# PHP mbstring - for improved UTF-8 sorting support (optional)
# PHP MySQL 5

All you help to resolve this problem is greatly appreciated. In advanced, Thanks
 
Old 11-27-2007, 06:28 PM   #2
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Did you add/uncomment "Include /etc/httpd/mod_php.conf" in your httpd.conf?

Brian
 
Old 11-27-2007, 06:51 PM   #3
Ramonvel
LQ Newbie
 
Registered: Aug 2007
Posts: 19

Original Poster
Rep: Reputation: 0
HI Brian,

Thanks for your quick response. I looked under httpd.conf. I added

"LoadModule php5_module modules/libphp5.so"
and
modified the index.html line and add index.php to the list.

Besides the above, there is no other php word on the file.
 
Old 11-27-2007, 06:58 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
In my httpd.conf I have the following PHP related lines:
Code:
LoadModule php5_module        modules/libphp5.so
DirectoryIndex index.html index.html.var index.php
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
Hope that helps.
 
Old 11-27-2007, 07:03 PM   #5
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
You should have a mod_php.conf file in /etc/httpd. This file will take care of loading the module and create the application types. The "Include" line I gave you will source that file so you don't need to add all that other stuff into your httpd.conf.

Brian
 
Old 11-27-2007, 08:03 PM   #6
Ramonvel
LQ Newbie
 
Registered: Aug 2007
Posts: 19

Original Poster
Rep: Reputation: 0
PHP 5 Installation with Modules

Hi Guys,

Brian, I did it both way. I added all those modules on httpd.conf and disabled those and added "Include /etc/httpd/mod_php.conf". Unfortunelly, it didn't work either.

Everytime I click on the index.php, now, it try to download the file instead of opening the page.

Any other recommendation, please.

Note: How do I know if the following are installed?

# PHP PEAR 5 including DB, Mail and Mail_Mime
# PECL FileInfo
# PHP mbstring - for improved UTF-8 sorting support (optional)
# PHP MySQL 5
 
Old 11-27-2007, 08:12 PM   #7
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Did you restart apache after modifying the files?

Brian
 
Old 11-27-2007, 08:28 PM   #8
Ramonvel
LQ Newbie
 
Registered: Aug 2007
Posts: 19

Original Poster
Rep: Reputation: 0
Help PHP5 installation with modules

Yes I did. I even went further than that. I restarted the server.
 
Old 11-27-2007, 10:25 PM   #9
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 62
I have the following line in addition to what gilead mentioned.

Code:
AddHandler php5-script php
 
Old 11-27-2007, 10:53 PM   #10
Ramonvel
LQ Newbie
 
Registered: Aug 2007
Posts: 19

Original Poster
Rep: Reputation: 0
PHP5 problems

Hi Tux,

Thanks for your help. Yes, I tried that as well, but no luck. Any other recommendation.

Thanks,
 
Old 11-27-2007, 11:33 PM   #11
agentc0re
Member
 
Registered: Apr 2007
Location: SLC, UTAH
Distribution: Slackware
Posts: 200

Rep: Reputation: 34
This is what i had to do to make it work.

At the every end of my httpd.conf file i had a line
Code:
#Include /etc/httpd/mod_php.conf
I uncommented it.

went to my mod_php.conf file and edited
Code:
LoadModule php5_module lib/httpd/modules/libphp5.so
To be
Code:
LoadModule php5_module /usr/lib/httpd/modules/libphp5.so
After that i test out php by doing the following
Code:
cd /srv/httpd/htdocs
vim test.php
< ?php phpinfo() ?>
:wq
apachectl restart
Go to a web browser, yourserver-name/test.php
and you should see a bunch of php info.

Still doesn't work? One other thing i think i remember having to add was MultiViews to my document root options.
Code:
<Directory "/srv/httpd/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks MultiViews

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>
 
Old 11-28-2007, 01:22 AM   #12
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Everything should be set as agentc0re said except MultiViews option is not necessary:
Quote:
The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match (??? - what's the best match foo.a or foo.b?) to the client's requirements.

Last edited by Alien_Hominid; 11-28-2007 at 01:27 AM.
 
Old 11-28-2007, 07:23 AM   #13
agentc0re
Member
 
Registered: Apr 2007
Location: SLC, UTAH
Distribution: Slackware
Posts: 200

Rep: Reputation: 34
Quote:
Originally Posted by Alien_Hominid View Post
Everything should be set as agentc0re said except MultiViews option is not necessary:
Heh, i meant to come back and say it wasn't necessary. I think i set that because i was having trouble in the beginning and i was looking at my slack 11 setup and in my conf file on that box, it's in there by default. when in fact it all ended up being a problem with the mod_php.conf file.
 
Old 11-28-2007, 04:17 PM   #14
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
You should not need to edit the mod_php.conf file to add "/usr/" before the module pathname, as you should have a line in your httpd.conf 'ServerRoot "/usr"' which tells apache where to look. You do not need the AddHandler line either.

Are you sure the index.php file contains valid php and that the opening and closing tags are correct? For example, there is a syntax error in agentc0re's test.php file, namely the space between < and ?php, so it will not run properly as written.

Brian
 
Old 11-28-2007, 04:27 PM   #15
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by Ramonvel View Post
Note: How do I know if the following are installed?

# PHP PEAR 5 including DB, Mail and Mail_Mime
# PECL FileInfo
# PHP mbstring - for improved UTF-8 sorting support (optional)
# PHP MySQL 5
If you use the test script agentc0re suggested (without the space between '<' and '?php') you will see whether or not these options are installed. If you used the Slackware packages, you _should_ be set to go. BTW, I believe that PEAR is standard in PHP now, and will be there unless specifically _excluded_.

Brian
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
PHP Modules in Fedora Core 5 :.:Numark:.: Fedora 2 09-03-2009 12:18 AM
new php modules wooot SUSE / openSUSE 1 07-18-2005 12:02 PM
configuring apache to activate php modules? vickr1z Linux - Newbie 2 09-02-2004 03:27 AM
PHP Modules (IMAP, Mcrypt, and MCAL) grahammm Linux - Software 0 08-02-2004 02:47 AM
PHP modules hardigunawan Programming 0 05-15-2002 05:08 AM

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

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