Re: Installation issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Tommy/Keith/Newsgroup,

 

Thank you for the input, I REALLY appreciate it.  I did everything you said but it still does not work.  A few observations:

 

1) Yes I am running on Windows XP.  So it seems that I shouldn't do any of the "*.so" stuff that Keith mentioned, that seems like a UNIX thing.  If I can just get the thing to work, I will split my PHP definitions off into another file just as Keith recommends.  However for now I just want it to work.

 

2) What exactly am I supposed to rename in the php directory?  Your email just said "rename the PHP file" ... the documentation says to rename either the php.ini-recommended or php.ini-dist as php.ini.  So I renamed the php.ini-recommended to php.ini in my PHP directory, which I installed in C:\php.

 

3) Here are the changes I made to conf\httpd.conf:

#JRA added this
#Preload the PHP interpreter so that Apache can find it
#even if it's not in the path
LoadFile "C:\php\php5ts.dll"
LoadModule php5_module "C:\php\php5apache2_2.dll"
PHPIniDir "C:\php"
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps

 

The problem with this is that I cannot find the "application" directory ANYWHERE.  I downloaded what I thought was/is the latest version of Apache from a mirror site, but there is no application directory.  Nothing in the instructions mentions such a directory, that I read anyway.  Do I just need to create it manually?  Confusing.  I tried these definitions with both forward and backward slashes, and it made no difference.

 

4) I did not copy the php.ini file anywhere.

 

5) I did add "C:\php" to the PATH environment variable.  Is that really a problem?


6) I have issued many "bin\httpd.exe -k [start|stop]" commands recently, nothing has changed.

 

7) Below is what I get when typing http://localhost into a browser window:

<html><body>
<h1>It works!</h1>
<?php
echo "PHP test\n";
?>
</body></html>

Note that I modified the file a bit just to see if I could get the php echo text to appear in the browser in addition to the It works! text...

 

8) Is there an installation issue at work here?  Do I need to install PHP only AFTER installing Apache?

 

Thanks for any help.  I am LOST!

Jerry

Keith,
If you can't get this working, and you are using a Windows, not Linux/Unix machine, do the following (the online doc are not complete or detailed enough I have found):

1) Rename the PHP file in your PHP directory to PHP.ini (add the .ini extension to it).
2) In your Apache httpd.conf file (localed in the apache's conf directory do the following

Here is the proper apache directives to load php, preferbly saved as php.conf and included from your main config.

#load the php main library to avoid dll hell
Loadfile "C:\pathtophp\php5ts.dll"

#load the sapi so that apache can use php
LoadModule php5_module "C:\pathtophp\php5apache2_2.dll"

#set the php.ini location so that you don't have to waste time guessing where it is
PHPIniDir "C:\pathtophp"

#Hook the php file extensions, notice that Addtype is NOT USED, since that's just stupid
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps

3)
Do not copy any php files anywhere
Do not edit the system path. If you have deleted them.

4) Delete any additions from you httpd.conf and php.ini that you have made to try to get it to work.

5) restart your apache server. It should work.


[Index of Archives]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [Postgresql]     [PHP Books]     [PHP Databases]     [PHP SOAP]
  Powered by Linux