Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache 2.2 works fine, but PHP5.2... |
|
Author |
|
m august
Joined: 16 Jul 2006 Posts: 7 Location: Houston, Texas
|
Posted: Mon 17 Jul '06 3:50 Post subject: Apache 2.2 works fine, but PHP5.2... |
|
|
I am a rank novice at all this, so I appreciate immensely any help you can supply. I have uncommented the extension=php_mysql.dll directive in the PHP/php.ini file (I'm using Apache 2.2 with Windows XP and PHP5.2). I also set the extension directory as follows:
extension_dir = "c:/PHP/ext"
When I call up one of my new pages from the Apache2.2/htdocs in a Firefox browser it displays all the text and html features perfectly, but I don't see any results from the <?php phpInfo(); ?> tag that I placed in the page. If PHP were working, shouldn't I see a list of extensions used? |
|
Back to top |
|
urangkayo
Joined: 04 Jul 2006 Posts: 11 Location: Depok - Indonesia
|
Posted: Mon 17 Jul '06 8:13 Post subject: |
|
|
if you using in windows XP look at httpd.conf and php.ini
at httpd.conf
Quote: | DocumentRoot "T:/public_html" | <-- path for your web root
Quote: | # This should be changed to whatever you set DocumentRoot to.
#
<Directory "T:/public_html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI |
Change the bold text with your path for your web root.
And also have you add php handler for .php file ad your httpd.conf ?
Quote: | LoadModule php5_module "T:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "T:/php" |
in php.ini change this line
Quote: | doc_root = "T:\public_html\" | remember use backslash at php.ini not slash
at your php.ini
Quote: | extension_dir = "c:/PHP/ext" | you must change to
Quote: | extension_dir = "c:\PHP\ext\" |
i hope this can help you |
|
Back to top |
|
m august
Joined: 16 Jul 2006 Posts: 7 Location: Houston, Texas
|
Posted: Mon 17 Jul '06 19:45 Post subject: I Have Done All That, And Still Nothing |
|
|
I already had made most of those changes to conf.httpd and php.ini, and I added the ones for DocumentRoot, <Directory ...> and doc_dir. Once again, there are no error messages in the logs.error file and the only thing it says about PHP is:
Apache/2.2.2 (Win32) PHP/5.2.0-dev configured -- resuming normal operations
I can call up pages that I have newly created out of my htdocs file, and they look just fine, but I do not see any results from my phpInfo call which is the first code placed immediately after the body tag, as follows:
<body>
<?php phpInfo(); ?>
<ul>
Anyone have any suggestions? |
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Mon 17 Jul '06 22:05 Post subject: |
|
|
For troubleshooting purposes ONLY, make these changes in your PHP.INI file:
error_reporting = E_ALL
display_errors = On ;displays errors in browser
display_startup_errors = On
To maintain a log:
log_errors = On
error_log = "C:/php/error.log" ;create the error.log file and change for your use
Once you have things fixed up, make sure you change display_errors back to Off
Also, check out the post below:
http://www.apachelounge.com/viewtopic.php?t=570 |
|
Back to top |
|
m august
Joined: 16 Jul 2006 Posts: 7 Location: Houston, Texas
|
Posted: Mon 17 Jul '06 23:17 Post subject: Thanks Again for the help (I'm in Texas too) |
|
|
Well, I turned on all those options as you said and I see absolutely nothing in my php/error.log file (it is totally blank) and I pointed to:
error_log = "C:/php/error.log"
just like you said. I also notice that in my php.ini file, my user_dir is not set. It appears uncommented exactly like this:
user_dir =
There are also some mysql directives in the [MySQL] section uncommented and empty like that. The mysql port, socket, host, user and password defaults are all uncommented and empty. Does that ever cause problems?
By the way, I'm sitting here in Houston on the bay. What part of Texas are you in? And thanks again for your help. |
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Mon 17 Jul '06 23:37 Post subject: |
|
|
Rather than using PHP 5.2 (since it is still in development), try using PHP 5.1.4 instead (since it's consider stable).
Also, view the post below:
http://www.apachelounge.com/viewtopic.php?t=570
INFO U: Sugarland |
|
Back to top |
|
m august
Joined: 16 Jul 2006 Posts: 7 Location: Houston, Texas
|
Posted: Wed 19 Jul '06 2:30 Post subject: Solved It! Bet a LOT of Newbies have this problem |
|
|
Ok. I finally got it to work with PHP 5.2 and Apache 2.2.2
First of all, it goes without saying that one must make all the recommended changes to the httpd.conf (insert the proper LoadModule, LoadFile, AddHandler, and PHPIniDir directives). One must also be sure to make the proper changes to php.ini
On the way to accomplishing this, a newbie encounters a blizzard of unclear solutions as he threads his way through all the suggestions on the dozens of sites he's searching.
The documentation is of tentative help at best because of all the possible pitfalls it ignores for a novice. For example, when suggesting modifications to the php.ini, there REALLY should be a reminder for Windows users that if one creates a php.ini file, it must actually BE exactly like that in the directory and not a php.txt or php.ini.txt file. It's subtle and easily missed if one is in a hurry. When one uses 'dir' at a 'cmd' prompt, it becomes obvious. It's similarly easy to make the same superfluous naming errors if one creates ones own .html or .php files in htdocs.
In the end, I had done everything right EXCEPT something incredibly obvious. I had created my test page in Apache2.2\htdocs by editing an existing .html file. I finally remembered reading somewhere in the murky past that one had to insert the php tags into an actual .php file, not an .html file, but in the chaos of reading 20 different forum entries and apache documents, the thought never occurred to me. Now, of course, <?php phpInfo(); ?> works beautifully and one gets that vast procession of PHP tables that tells virtually everything about the configuration as it actually is. Obvious to a PHP coder, but easily missed by a novice. |
|
Back to top |
|
Bob Stokesbary
Joined: 07 Aug 2006 Posts: 1
|
Posted: Mon 07 Aug '06 5:40 Post subject: |
|
|
m august
GOD BLESS YOU! In the hassle of trying to get all this to work I too forgot the extension thing. I have been battling this for 2 days now doing all the reloads, etc. I did everything by the book like you did. My ONLY mistake was that I was using index.html, not index.php. When I made the change everything works OK.
Thanks for taking the time to point out your mistake. You saved me many more hours of wasted time. (I just discovered this forum tonight at the height of my frustration.) |
|
Back to top |
|
|
|
|
|
|