LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 10:53 AM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
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 11:09 AM.
 
Old 11-17-2009, 11:21 AM   #2
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Original Poster
Rep: Reputation: 69
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 11:26 AM.
 
  


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

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

All times are GMT -5. The time now is 03:10 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration