Page 1 of 2

Installation, testing question

Posted: Sat Aug 26, 2006 8:39 pm
by Grafixx01
Hello everyone,

Yes, I am a complete NOVICE at the whole MySQL, Apache and PHP arena. I am trying to develop a site much like this however I cannot actually disclose what it will be used for due to security reasons.

My issue is as follows:

I bought the Sams Teach Yourself PHP, MySQL and Apache All-In-One book and it came with the CD with the programs on it. It's a fairly easy read and all so far.

I installed MySQL and Apache fine. Or I should say that they both seemed to install fine. I went to php.net to get the latest version of PHP, 5.1.6. I unzipped that and put it into the ' C:\php5 ' directory like specified.

I edited the httpd.conf file with the required lines (depicted below):

LoadModule php5_module c:/php5/php5apache2.dll
AddType application/x-httpd-php .php .html
PHPIniDir "C:\php5"

So when finished, I tried the ' http://localhost ' and it showed the Apache page. However, I tried to make the 'test file' for PHP and input ' http://localhost/phpinfo.php ' into the web browser (firefox and IE) and both returned a cannot display page error.

Anyone know what I did wrong? Please help!

I'll probably be posting a lot of questions so I hope you all have a lot of answers and don't get annoyed.

Thanks in advance,

B

Posted: Sat Aug 26, 2006 8:42 pm
by feyd
Where did you place the file phpinfo.php? If it is not in the Apache document root, you'll get such an error.

Posted: Sat Aug 26, 2006 8:51 pm
by Grafixx01
feyd wrote:Where did you place the file phpinfo.php? If it is not in the Apache document root, you'll get such an error.
That's funny! ALL of the books on PHP that I have say to put it in the ' C:\php5 ' directory!!!


**NOPE, wait...

I put it in the ' C:\Program Files\Apache Group\Apache2\htdocs ' directory and still the same issue...

Did I put it in the wrong directory?

Posted: Sat Aug 26, 2006 9:04 pm
by feyd
did you restart Apache after you changed the configuration file?

Posted: Sat Aug 26, 2006 9:12 pm
by Grafixx01
Yep, restarted it and even went as far as restarting the machine completely.

Posted: Sat Aug 26, 2006 9:35 pm
by Weirdan
throw an empty index.html file into your htdocs directory and see if apache test page goes away.

Posted: Sun Aug 27, 2006 12:21 am
by Grafixx01
Weirdan wrote:throw an empty index.html file into your htdocs directory and see if apache test page goes away.
Nah, didn't work either.

The ' http://localhost ' command on IE and Firefox show the Apache page. It's the ' http://localhost/phpinfo.php ' file that does not display the php configuration or details.

You know what I mean?

I've tried to reinstall ALL of the aspects (MySQL, PHP, Apache) , even cleared all registry entries and the edit to the MS Windows PATH file. It still doesn't work.

Any more suggestions?

Posted: Sun Aug 27, 2006 12:25 am
by feyd
Placing an index.html in your document root should have made Apache not display the "you're running Apache" page opting for that page instead. If that doesn't work, you have something wrong in the configuration of Apache.

Posted: Sun Aug 27, 2006 12:44 am
by Grafixx01
Alright, I'm going to uninstall and reinstall EVERYTHING. Delete ALL files and registry entries that were made. When I reinstall it all, I'm going to accept ALL defaults.

The question is:

When I have to edit the httpd.conf file in Apache, where do I put the below statements EXACTLY? And did I type them wrong?...

LoadModule php5_module c:/php5/php5apache2.dll
AddType application/x-httpd-php .php .html
PHPIniDir "C:\php5"

Posted: Sun Aug 27, 2006 8:25 am
by feyd
I generally place the loadmodule and phpinidir directives near the other loadmodule directives.

The addtype I place toward the end of the file along with all the other custom directive I may add (unrelated to PHP) to make it slightly easier to find and edit them all at once.

Posted: Sun Aug 27, 2006 9:33 am
by Grafixx01
ARGH...

Ok, did what you said Feyd. As far as the placement of the LoadModule and AddType lines in the httpd.conf file. I did this after deletion and reinstallation of all of the programs. MySQL, PHP 5 and Apache 2.0.58.

Same issue still resides. I followed the instructions step by step for all of the programs from BOTH books that I have on MySQL, PHP 5 and Apache. Anyone have any ideas?

Posted: Sun Aug 27, 2006 10:33 am
by volka
Maybe you find xampp more relaxing.

Posted: Sun Aug 27, 2006 12:14 pm
by Grafixx01
I'll look into it. I absolutely HATE giving into something just for something easier though.

Posted: Sun Aug 27, 2006 12:52 pm
by volka
First you have to find the right httpd.conf - the file where the apache httpd reads its configuration from.
Insert

Code: Select all

TheDirectiveThatWasnt <>
at the beginning and try to start the apache. It shouldn't work. If it does you didn't edit the right httpd.conf. (Do not forget to remove the line)

When you have found the proper httpd.conf search for DocumentRoot
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot
Place your test.php into the directory DocumentRoot is pointing to. Then call http://localhost/test.php

Posted: Sun Aug 27, 2006 3:15 pm
by Grafixx01
Ok, did all that and still I get:

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.


The line that you said to add "TheDirectiveThatWasn' <>", that worked. When I restarted Apache it said, "Error". Took it out and it restarted fine.

Then I renamed my phpinfo.php to test.php and still, returned the error above.

Do you think that I did something wrong with the installation of PHP? or the editing of the httpd.conf file? I searched and put the required lines in at the end of the section WITHOUT '#' signs infront of it to negate it. Still nothing.

Is there certain areas it must be in? I even upgraded from the version of PHP that was on the CD that came with the book (it was like 5.1.4 and I put in 5.1.6, directly from php.net)