SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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, 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
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>
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.
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.
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.
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_.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.