3 Replies - 816 Views - Last Post: 08 July 2010 - 08:04 PM

#1 bigdawg24  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 288
  • Joined: 18-August 07

Apache and PHP

Posted 08 July 2010 - 06:59 PM

So I have taken this a bit further since the last post. I have installed PHP on my machine... I have made changes that will be indicated below accordingly to the book that I am reading helping myself with this. Since I made these changes when I goto restart/start apache in Services ( control panel --> administrative --> services ) it wont let me... having some sort of error... below is what I was told to do

Quote

Configuring Apache to Use PHP
Now that both Apache and PHP are installed, there are a few more customizable options that need to be
adjusted. To configure Apache to recognize a PHP file as one that needs to be parsed with the PHP
engine, you need to first locate the following lines in your httpd.conf file:
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz


Then add the following lines:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir “C:\PHP”
If you installed PHP in a location other than the recommended C:\PHP , then make sure your path
matches the location of the directory.
Next, you need to add the PHP module into your httpd.conf program so that Apache can properly
coordinate with PHP to serve the dynamically generated pages PHP will produce. In your configuration
file, locate the following lines:
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding ‘LoadModule’ lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by ‘httpd -l’) do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
...
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
Add the following line:
LoadModule php6_module “C:\PHP\php6apache2_2.dll”
Again, make sure your path matches the location of the php6apache2_2.dll file if you did not install
PHP in the recommended directory.
Oh, and remember to restart Apache after you ’ ve saved your modifications to httpd.conf or else
Apache will not be aware of your changes!



So - as I have said, I added the code as the literature states. I get the services issue thus adding any test php to my localhost folder to see if it worked is futile; is there any help here or do I need to do something different?

Is This A Good Question/Topic? 0
  • +

Replies To: Apache and PHP

#2 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5345
  • View blog
  • Posts: 27,296
  • Joined: 10-May 07

Re: Apache and PHP

Posted 08 July 2010 - 07:00 PM

Have you viewed the Apache logs? What OS is this installed on?
Was This Post Helpful? 0
  • +
  • -

#3 bigdawg24  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 288
  • Joined: 18-August 07

Re: Apache and PHP

Posted 08 July 2010 - 07:55 PM

installed on win 7 64bit - not sure about the logs - cant find them?
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5345
  • View blog
  • Posts: 27,296
  • Joined: 10-May 07

Re: Apache and PHP

Posted 08 July 2010 - 08:04 PM

Check for access & error logs in httpd.conf

Also, check this out : http://apache-log-an....smartcode.com/
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1