943,923 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 7653
  • PHP RSS
Jun 11th, 2007
0

Problem when configure PHP5 with Apache2

Expand Post »
It is my first time in here and also my first question. I hate to admit it that
I got stuck now. I got the Apache set up on my new computer and also
the PHP5. After that, I modified the Apache2 httpd.conf file.

I added this into my configure file
PHP Syntax (Toggle Plain Text)
  1. LoadModule php5_module "c:/php/php5apache2.dll"

Then when I restarted my server. I got this error.

Quote ...
http.exe: Syntax errror on line 115 of C:/Program Files/Apache Software
Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/php/php5apache2.dll
into server: The specified module cound not be found.
Similar Threads
Reputation Points: 350
Solved Threads: 63
Posting Pro
invisal is offline Offline
562 posts
since Mar 2005
Jun 11th, 2007
0

Re: Problem when configure PHP5 with Apache2

Click to Expand / Collapse  Quote originally posted by invisal ...
It is my first time in here and also my first question. I hate to admit it that
I got stuck now. I got the Apache set up on my new computer and also
the PHP5. After that, I modified the Apache2 httpd.conf file.

I added this into my configure file
PHP Syntax (Toggle Plain Text)
  1. LoadModule php5_module "c:/php/php5apache2.dll"
Then when I restarted my server. I got this error.
Yes, indeed this is a really common problem.
1. Check if you have added php dir into your windows path.
2. Then check if you have this file in your PHP distro: "php5apache2_2.dll"
3. Then configure the apache conf like this

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

This should work.

Good Luck.
Reputation Points: 21
Solved Threads: 26
Posting Whiz in Training
Rhyan is offline Offline
240 posts
since Oct 2006
Jun 12th, 2007
0

Re: Problem when configure PHP5 with Apache2

Thanks! It is worked now. However, I have encounter about problem.
When I started my server, there wasn't any error but when I run my php
script it won't work at all.

Here my php script
PHP Syntax (Toggle Plain Text)
  1. <?
  2. echo "Hello World";
  3. ?>
  4. Hello World

And when I run it. It won't display anything only a empty page.
Reputation Points: 350
Solved Threads: 63
Posting Pro
invisal is offline Offline
562 posts
since Mar 2005
Jun 12th, 2007
0

Re: Problem when configure PHP5 with Apache2

Use <?php echo "Hello world"; ?> instead. From version 4.something PHP needs to have the full tag "<?php " in order to recognize the script as php.

Run through the PHP manual for your version, as there are several changes from older versions.

Good luck.
Reputation Points: 21
Solved Threads: 26
Posting Whiz in Training
Rhyan is offline Offline
240 posts
since Oct 2006
Jun 12th, 2007
0

Re: Problem when configure PHP5 with Apache2

I have tried what you told me to do. But still not work.....

Here it is my code:
PHP Syntax (Toggle Plain Text)
  1. <html>
  2. <head></head>
  3. <body>
  4. <?php
  5. print "testing";
  6. ?>
  7. </body>
  8. </html>

and when I view the source of it. I only see empty source of the page
too....
Reputation Points: 350
Solved Threads: 63
Posting Pro
invisal is offline Offline
562 posts
since Mar 2005
Jun 13th, 2007
0

Re: Problem when configure PHP5 with Apache2

Hm...very strange.
Check the following:
1. Check php.ini whether you have correctly entered the path to your web folder. e.g. if you apache is located on c:\apache\ and your document root folder is htdocs, then the php.ini should point to c:/apache/htdocs/

2. Put your file named e.g. test.php into the web dir - e.g. c:\apache\htdocs\test.php

3. Check what addresses your apache server is monitoring - e.g. localhost:80 or 127.0.0.1:80. If you are not sure you can just put it like this *:80 and it will monitor all ip addresses assigned to your computer.

4. Open the browser and try accessing your php file like you would do with a normal web page, however your url should look like this:
e.g. http://localhost/test.php or http://127.0.0.1/test.php

Do check all of the above and advise what is the final result.

Good luck.
Reputation Points: 21
Solved Threads: 26
Posting Whiz in Training
Rhyan is offline Offline
240 posts
since Oct 2006
Jun 14th, 2007
0

Re: Problem when configure PHP5 with Apache2

Anyway, it doesn't work. But I found these error on my Apaches Server.

Quote ...
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_exif.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_ldap.dll' - The operating system cannot run %1.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_oci8.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_openssl.dll' - The operating system cannot run %1.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_pdo_oci.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_pdo_oci8.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_pdo_sqlite_external.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_pspell.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_sybase_ct.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_ibm_db2.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_ifx.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_ingres.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_maxdb.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_mcve.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_netools.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_oracle.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_pdo_ibm.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_pdo_informix.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_ssh2.dll' - The operating system cannot run %1.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_svn.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Notice: Constant XML_ELEMENT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_TEXT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_CDATA_SECTION_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ENTITY_REF_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ENTITY_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_PI_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_COMMENT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_DOCUMENT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_DOCUMENT_TYPE_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_DOCUMENT_FRAG_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_NOTATION_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_HTML_DOCUMENT_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_DTD_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ELEMENT_DECL_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_DECL_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_ENTITY_DECL_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_NAMESPACE_DECL_NODE already defined in Unknown on line 0
PHP Notice: Constant XML_LOCAL_NAMESPACE already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_CDATA already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_ID already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_IDREF already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_IDREFS already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_ENTITY already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_NMTOKEN already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_NMTOKENS already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_ENUMERATION already defined in Unknown on line 0
PHP Notice: Constant XML_ATTRIBUTE_NOTATION already defined in Unknown on line 0
Reputation Points: 350
Solved Threads: 63
Posting Pro
invisal is offline Offline
562 posts
since Mar 2005
Jun 15th, 2007
0

Re: Problem when configure PHP5 with Apache2

Now, about the loading of modules - you do not have to enable an extention if you're not planning to use it.

To disable a module, open your php.ini and put the # sign in front of each extention.

The most common extentions you should enable by not putting the # sign in front are mysql(if you are using a mysql database) and gd2 - this is a handy extention for manipulation of pictures and image files.

If you're not using the rest of the extentions, just disable them.

Then, after editing and saving the php.ini file, restart the apache server. Then create a new php document, e.g. test.php, and put it in the apache document_root directory. In the test.php file put only this statement:

<?php phpinfo(); ?>

By typing in your browser http://localhost/test.php you should see a very nice table with infromation about your php installation.

Check and advise what is the outcome. If everything is ok, you should see the nice table with a lot of info. If php is not working, then you should see the php code in your browser window.

Cheers.
Reputation Points: 21
Solved Threads: 26
Posting Whiz in Training
Rhyan is offline Offline
240 posts
since Oct 2006
Jun 15th, 2007
0

Re: Problem when configure PHP5 with Apache2

After I disable some php extension, finally, it's working. When I ran my
code I saw a nice table of php info. However, I also got immediately
apaches error and suddenly shut down my apaches server. and
here is the error i found in apaches error log file:

Quote ...
[Fri Jun 15 03:53:27 2007] [notice] Child 4488: Child process is running
[Fri Jun 15 03:53:27 2007] [notice] Child 4488: Acquired the start mutex.
[Fri Jun 15 03:53:27 2007] [notice] Child 4488: Starting 250 worker threads.
[Fri Jun 15 03:53:27 2007] [notice] Child 4488: Starting thread to listen on port 80.
Error in my_thread_global_end(): 255 threads didn't exit
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)
[Fri Jun 15 03:54:20 2007] [notice] Parent: child process exited with status 3221225477 -- Restarting.
Error in my_thread_global_end(): 3 threads didn't exit
Reputation Points: 350
Solved Threads: 63
Posting Pro
invisal is offline Offline
562 posts
since Mar 2005
Jun 15th, 2007
0

Re: Problem when configure PHP5 with Apache2

Hmm... very awkward problems you have.

I ran the error status on google, and got a lot of reported errors like this. Most of them lead to an incompatible versions of Apache and PHP.

So, please check the apache.org and the php.net for the latest versions and eventually compatibility issues.

I suggest you uninstall the current versions of both apache and php and reinstall them from scratch.

Apache has an installation guide if you download the win32 installer, which will guide you through the instal process.

About php I am not very sure, however, in the root dir of php there is a file like php.ini.recommended. You can use this file like a guide for setting up correctly php with apache and you should finaly save it as php.ini .

Look for other solutions to your problem on the net, still my opinion is you'd better start from scratch.
Reputation Points: 21
Solved Threads: 26
Posting Whiz in Training
Rhyan is offline Offline
240 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP testing server no syntax error just blank web page
Next Thread in PHP Forum Timeline: display google map using php





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC