LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2009, 09:53 AM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 70
Configuring php with apache in Slackware 13.0...


I'm getting ready to glue my postgresql database to my website with PHP. I tested that php was up and running by doing

Code:
php -v
I'm running v2.2.0. I have uncommented the appropriate line in /etc/httpd/mod_php.conf, namely

Code:
AddType application/x-httpd-php .php
I have also copied the php.ini file to /usr/local/lib. I then restarted apache and still my /var/www/htdocs/helloworld.php file would not work.

helloworld.php
Code:
<html>
<body>

<?php
print "Hello, world.";
?>

</body>
</html>
I test it by opening that file through firefox and inputing 127.0.0.1/helloworld.php. I end up getting the source code of the file instead of just seeing "Hello, world." I've also added an executable permission to the helloworld.php.

I have also tried adding the AddType line mentioned above in the httpd.conf file and still nothing.

1. I am wondering if maybe I need to uninstall apache and then reconfigure it with php and then install?

2. Also, I want to use Postgresql with apache and php. What else do I need to do to make Postgresql accessible to apache and php?

3. Now for some reason, whenever I try to access a php file in firefox it prompts me to open it. How do I change that?

Last edited by trist007; 11-17-2009 at 10:09 AM.
 
Old 11-17-2009, 10:21 AM   #2
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Original Poster
Rep: Reputation: 70
I think I might have fixed php. I uncommented the line

Code:
Include /etc/httpd/mod_php.conf
in the httpd.conf file. However, firefox and konqueror try to download or open a php file instead of running it. How do I fix this?

I got it to work. I just need to make sure httpd.conf and mod_php.conf were nice and neat.

Last edited by trist007; 11-17-2009 at 10:26 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
Configuring Apache with PHP wassimdarwich Fedora 1 11-25-2008 11:59 PM
Configuring Apache and PHP home_art Linux - General 1 04-11-2007 10:54 PM
configuring apache, php mjl3434 Linux - Software 4 09-22-2005 06:49 PM
Configuring php on apache Dakkar Linux - Software 5 06-01-2004 09:26 AM
Configuring Apache and PHP... causticmtl Slackware 2 07-06-2003 01:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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