Installation, testing question

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

User avatar
Grafixx01
Forum Newbie
Posts: 13
Joined: Sat Aug 26, 2006 8:27 pm

Installation, testing question

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
Grafixx01
Forum Newbie
Posts: 13
Joined: Sat Aug 26, 2006 8:27 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

did you restart Apache after you changed the configuration file?
User avatar
Grafixx01
Forum Newbie
Posts: 13
Joined: Sat Aug 26, 2006 8:27 pm

Post by Grafixx01 »

Yep, restarted it and even went as far as restarting the machine completely.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

throw an empty index.html file into your htdocs directory and see if apache test page goes away.
User avatar
Grafixx01
Forum Newbie
Posts: 13
Joined: Sat Aug 26, 2006 8:27 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
Grafixx01
Forum Newbie
Posts: 13
Joined: Sat Aug 26, 2006 8:27 pm

Post 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"
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
Grafixx01
Forum Newbie
Posts: 13
Joined: Sat Aug 26, 2006 8:27 pm

Post 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?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Maybe you find xampp more relaxing.
User avatar
Grafixx01
Forum Newbie
Posts: 13
Joined: Sat Aug 26, 2006 8:27 pm

Post by Grafixx01 »

I'll look into it. I absolutely HATE giving into something just for something easier though.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
User avatar
Grafixx01
Forum Newbie
Posts: 13
Joined: Sat Aug 26, 2006 8:27 pm

Post 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)
Post Reply