Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-01-2012, 12:16 AM   PM User | #1
BuzzMcPhearson
New to the CF scene

 
Join Date: Aug 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
BuzzMcPhearson is an unknown quantity at this point
Setting up php on apache

Here's what I got:
Installed php on my apache server per instructions.
Created a simple php form that opens the same page with - action="<?php $_SERVER['../PHP_SELF'];?>" But instead of opening the page it downloads it. The page works fine on other servers, but not the one that I set up the php.ini on. I'm assuming I messed something up during the configuration process. I did try using phpinfo() on a page and that worked fine. Any thoughts?
BuzzMcPhearson is offline   Reply With Quote
Old 08-01-2012, 12:38 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
First you need to load the module. That's done like so:
Code:
LoadModule php5_module "/path/to/php/php5apache2_4.dll"
That path is very specific to the php version and apache build. You'll need to look through and verify it against the version of apache you have (also very specific to the architecture and threading capabilities), and choose the proper version. It's name is: php{major}apache{major}_{minor}.dll/.so.

Next you need to add the type:
Code:
    AddType application/x-httpd-php .php
I usually wrap mine in mod_mime.c check.

Finally if you want it, you can add a directory index. Search for DirectoryIndex and simply add in index.php. These are separated by spaces.

Restart apache for the settings to take affect.
For an example, this is what I've done for 5.4 build:
Code:
<IfDefine PHP_5_4_0>
  LoadModule php5_module "D:/Server/PHP/php-5.4.0/php5apache2_4.dll"
  PHPINIDir "D:/Server/PHP/PHP-5.4.0/"
  <IfModule mod_mime.c>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
  </IfModule>
</IfDefine>
That lets me load a module for PHP5, set its directory and add its type.
Fou-Lu is offline   Reply With Quote
Old 08-01-2012, 02:14 AM   PM User | #3
BuzzMcPhearson
New to the CF scene

 
Join Date: Aug 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
BuzzMcPhearson is an unknown quantity at this point
I originally put this at the end of the LoadModule lines:
Code:
LoadModule php5_module "c:/php/php5apache2_2.dll"
Added this to the end of the AddType Lines:
Code:
AddType application/x-httpd-php .php
And put this at the very end of the conf file:
Code:
PHPIniDir "c:/php"
BuzzMcPhearson is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:27 PM.


Advertisement
Log in to turn off these ads.