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

LoadModule php5_module "c:/php/php5apache2.dll"

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

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.

Member Avatar for Rhyan

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

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.

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

<?
echo "Hello World";
?>
Hello World

And when I run it. It won't display anything only a empty page.

Member Avatar for Rhyan

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.

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

Here it is my code:

<html>
<head></head>
<body>
<?php
	print "testing";
?>
</body>
</html>

and when I view the source of it. I only see empty source of the page
too....

Member Avatar for Rhyan

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.

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

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

Member Avatar for Rhyan

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.

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:

[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

Member Avatar for Rhyan

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.