LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Configuring php on apache (https://www.linuxquestions.org/questions/linux-software-2/configuring-php-on-apache-186479/)

Dakkar 05-27-2004 08:23 AM

Configuring php on apache
 
I just installed slackware 9.1 with php,mysql and apache but my php files are not working and i dont know how can i configure the apache conf in linux and in which directory includes apache config file.
Thanks

sio 05-28-2004 11:52 AM

generally navigate to
/etc/apache
and open your httpd.conf
scroll down to the very bottom and you'll see a line commented out concerning PHP.
Uncomment this line and save it.

See if that works out for you

Pete M 05-28-2004 12:20 PM

Dakkar

Your PHP configuration file is /etc/httpd/conf.d/php.conf, this should be OK as is

Your main apache configuration file is /etc/httpd/conf/httpd.conf

In httpd.conf make sure this line is uncommented

# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf

These lines may not be there, if not add them

# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

I would strongly suggest making a backup of your httpd.conf file, navigate to /etc/httpd/conf then enter cp httpd.conf httpd.save this will give you httpd.save to fall back on should you mess up,

When you make changes to httpd.conf dont forget to stop and start apache

In my case

/usr/sbin/apachectl stop
/usr/sbin/apachectl start

Hope this helps

Pete

sio 05-28-2004 02:12 PM

Actually in slackware (he said he had 9.1) its done a wee bit different.

the files for apache are in
/etc/apache

the two files of importance pertaining to him would be
httpd.conf & mod_php.conf

which should both be there on a default install.

The line at the bottom that i said to uncomment is designated specifically for php by the default conf file in slack.

The mod_php.conf will add php as a module and then setup the MIME types so theres no need for him to add that to his httpd.conf

In essence all he has to do is uncomment the line at the bottom of his httpd.conf relating to php, in Slackware 9.1

Guess i should have been more specific in what i said huh :D
"generally (in slackware 9.1 with the defaults) navigate to..."

Pete M 05-28-2004 02:35 PM

sio

No offense meant, just trying to help, never used slackware so perhaps I should have read the post more carefully.

Regards

Pete

sio 06-01-2004 09:26 AM

offence? no no no no, i just noted that i didn't say i was speaking specifically about slackware and my instructions were pretty bland at that no?

I only left the post after yours to clarify so he didn't go running around in slackware trying to find those things b/c he'd be totally lost then :)

Good days


All times are GMT -5. The time now is 09:16 PM.