yshua Posted February 12, 2014 Share Posted February 12, 2014 PHPIniDir "C:/PHP/" LoadModsule php5_module "C:/PHP/php5apache2_2.dll" AddType application/x-httpd-php .php Dear Readers: Have PHP5.3.8, MySQL5.1, Win8.1, Apache2.2, and put the above code at the bottom of httpd.conf file. Actual error message was, "httpd: Syntax error on line 499 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/PHP/php5apache2_2.dll into server: The specified module could not be found." Line 499 was about the blank line in the code above. And php5apache2_2.dll was put in the PHP folder, and in the htdocs folder, just to be sure. So this error is puzzling! Help, please, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/ Share on other sites More sharing options...
mac_gyver Posted February 12, 2014 Share Posted February 12, 2014 i'm willing to bet LoadModsule should be LoadModule Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1468553 Share on other sites More sharing options...
yshua Posted February 12, 2014 Author Share Posted February 12, 2014 Sorry, Y'all: My typo in transcribing! Was LoadModule in actual code.... Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1468558 Share on other sites More sharing options...
Ch0cu3r Posted February 12, 2014 Share Posted February 12, 2014 (edited) Where did you download Apache from httpd.apache.org or apachelounge.com If you got Apache from apache.org then you need to download Apache2.2 from apachelounge.com instead. The PHP distributions from windows.php.net/download are compiled with VC9 or VC11. The Apache binaries from apache.org are only compiled with VC6, making it incompatible with the PHP binaries from windows.php.net. Quote from php.net Which version do I choose? ApachePlease use the Apache builds provided by Apache Lounge. They also provide VC11 builds of Apache for x86 and x64. We use their binaries to build the Apache SAPIs. If you are using PHP with Apache 1 or Apache2 from apache.org (not recommended) you need to use the older VC6 versions of PHP compiled with the legacy Visual Studio 6 compiler. Do NOT use VC9+ versions of PHP with the apache.org binaries. You may also need to download the VC9 or VC11 runtime from Microsoft too. VC9 and VC11More recent versions of PHP are built with VC9 or VC11 (Visual Studio 2008 and 2012 compiler respectively) and include improvements in performance and stability. The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed. The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed. Edited February 12, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1468593 Share on other sites More sharing options...
yshua Posted February 13, 2014 Author Share Posted February 13, 2014 Dear Spoiler: Doubtless you put me right on the trail! Hope to get back with you as I spend the needed time to fill myself in on this.... Thanks tremendously, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1468676 Share on other sites More sharing options...
yshua Posted February 20, 2014 Author Share Posted February 20, 2014 OK, folks, am back again: Thanks for the advice, but am still up a creek, so to speak. Fully intend to try Apachelounge VC9 version of Apache and PHP 5.4.25, VC9 x86 nts. But this supposedly requires the dll, php5apache2_4.dll, which am unable to find. Is php5apache2_4.dll the right dll to have in PHP folder, and, if so, where can it be found? Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469599 Share on other sites More sharing options...
mac_gyver Posted February 20, 2014 Share Posted February 20, 2014 are you still getting a syntax error in the httpd.conf file? if so, it's possible you copy/pasted the line(s) into that file from somewhere and they actually have something like smart/curly-quotes, which is breaking the syntax. i would retype all the quotes to make sure they are simple/straight ' or " Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469614 Share on other sites More sharing options...
yshua Posted February 20, 2014 Author Share Posted February 20, 2014 Dear mac_gyver: I REALLY appreciate you all hanging in there with me! Am willing to try ANYTHING you all can think of.... Still am unable to find php5apache2_4.dll, which it showed in a video install procedure for Windows 8 was needed!!! Apache2.4 option: Will quickly review all things attempted. Retyped all questionable quotes in httpd.conf file and now have php5.dll where php5apache2_2.dll used to be for lack of php5apache2_4.dll. Unsurprisingly, am still receiving the error: httpd syntax error on line 176 of C:/Apache24/conf/httpd.conf : Can't locate API module structure 'php5_module' in file C:/php/php5.dll: No error. Oh, and even changed all occurrences of PHP to php, in compliance with video. Obtained VC9 version from Apachelounge.com. Am running exclusively the version without ssl for now. Tried to download Windows Server 2012 R2 from Microsoft but am unsure how the install "took." Apache 2.0 option: Am also "psyched" to try from scratch with Apache 2.0.26 and then installing dll's to comply with php5apache2_2.dll in conf file. In this case, am unsure how to download legacy Visual Studio 6 compiler.... Thanks for your patience, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469649 Share on other sites More sharing options...
Ch0cu3r Posted February 20, 2014 Share Posted February 20, 2014 (edited) When using PHP with Apache make sure you are downloading the thread safe version of php from windows.php.net/ Still am unable to find php5apache2_4.dll, which it showed in a video install procedure for Windows 8 was needed!!! Which video is this? Edited February 20, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469659 Share on other sites More sharing options...
yshua Posted February 20, 2014 Author Share Posted February 20, 2014 Dear Ch0cu3r: Thanks for your great advice. Can you please explain why thread safe version of php is needed? Am currently running MySQL 5.1.65, php-5.3.8-nts-Win32-VC9-x86 along with same php src. Used the .msi installer, but was unsure how to combine the source code with rest of installed php code. Must confess: Found myself arbitrarily copying code into php folder. Also, all voluminous php code from previous Windows 7 server was using currently installed MySQL 5.1.65, which installed fine on current pc. So am now using windows 8, soon to update to 8.1. Following your advice, found php5apache2_4.dll from apachelounge.com, from subset php version 4.3, in case php version 4.25 needs to be installed instead of current php5.3.8. New emsg reads: Httpd: Syntax error: Syntax error on line 176 of C:/Apache24/conf/httpd.conf: Cannot load C:\\php\\php5apache2_4.dll into server: The specified module could not be found. Would surely swap out php versions to help. Thanks, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469673 Share on other sites More sharing options...
yshua Posted February 20, 2014 Author Share Posted February 20, 2014 Dear Ch0cu3r: Noting the \\'s in last emsg, switched coded \'s to /'s in php load module statement, and emsg is now as follows: Httpd: Syntax error: Syntax error on line 176 of C:/Apache24/conf/httpd.conf: Cannot load C:/\php/php5apache2_4.dll into server: The specified module could not be found. Thanks again, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469676 Share on other sites More sharing options...
yshua Posted February 20, 2014 Author Share Posted February 20, 2014 Oops again! Typo in emsg should have read: Httpd: Syntax error: Syntax error on line 176 of C:/Apache24/conf/httpd.conf: Cannot load C:/php/php5apache2_4.dll into server: The specified module could not be found. Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469684 Share on other sites More sharing options...
Ch0cu3r Posted February 20, 2014 Share Posted February 20, 2014 (edited) Can you please explain why thread safe version of php is needed? because that is the version that works with apache. windows.php.net/download clearly states which is Thread Safe and Non Thread Safe. Am currently running MySQL 5.1.65, php-5.3.8-nts-Win32-VC9-x86 along with same php src. The non thread safe version (the one you have downloaded/installed) is for IIS, this could be why you keep getting the error message. And why the PHP src? That is only needed if you want to compile your own version, or extensions Used the .msi installer, but was unsure how to combine the source code with rest of installed php code. Uninstall PHP and do not use the installer it is not needed at all. Following your advice, found php5apache2_4.dll from apachelounge.com, from subset php version 4.3, in case php version 4.25 needs to be installed instead of current php5.3.8. ?? PHP4 is outdated. You should be using atleast PHP5.3 minimum. Noting the \\'s in last emsg, switched coded \'s to /'s in php load module statement, and emsg is now as follows: It doesn't matter if you use \\ or / in your file paths. I always use / in my file paths. Right lets start from the beginning. Uninstall Apache/PHP completely and delete any fils/folders leftover files from this process. Download a version of PHP5.x from windows.php.net/, making sure to chose the package that is labelled Thread Safe and is in zip format (stay clear of the installer). Take a mental note of the compile version you have downloaded (whether its VC9 or VC11) Once downloaded extract its contents to C:/php. Next head over to Apachelounge.com/download/. On the left, click of the VC version of PHP you just downloaded, now download the .zip file for Apache2.4.7. Once downloaded extract its contents to C:/apache Now open a command prompt with Administrative Privileges and run the following command C:/apache/bin/httdpd.exe -k install Now open windows exploder and navigate to C:/apache/bin/ApacheMonitor.exe and run it. (You might want to create a shortcut to the desktop for this as it a useful tool for controlling Apache). And click the Start button. This should load Apache with its default config state and should be running when you goto http://localhost. Now to configure it with PHP. Open the httpd.conf and add the following at the bottom of the file PHPIniDir "C:/PHP/" LoadModsule php5_module "C:/PHP/php5apache2_4.dll" AddType application/x-httpd-php .php Save the http.conf. Now using ApacheMonitor, click Restart and hopefully apache should now of loaded with PHP. You should be able to confirm this by creating a info.php file in C:/apache/htdocs, and then add the following code to it <?php phpinof(); ?> and then running http://localhost/info.php. You should see a page generated about PHP's configuration state and operating environment. A step I recommend you to take would be to add PHP to the Windows PATH Environment Variable. You do this by going to Start -> All Apps -> Control panel -> System -> Advanced System Settings -> Advanced -> Environment variables. On the window that pops up, select the Path from the System Variables list. Click Edit followed by pressing the End key on your keyboard. Now type C:\php; Click Ok to all windows, and then restart windows. Next rename C:/php/php.ini-recommended to C:/php/php.ini, and configure it use whatever extensions you require. Restart Apache after you have made any changes. Edited February 20, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469697 Share on other sites More sharing options...
yshua Posted February 20, 2014 Author Share Posted February 20, 2014 Dear Ch0cu3r: New emsg: C:\Apache24\bin>httpd.exe -k install Installing the Apache2.4 service The Apache2.4 service is succussfully installed. Testing httpd.conf.... Errors reported here must be corrected before the service can be started. All else, mission accomplished, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469722 Share on other sites More sharing options...
Ch0cu3r Posted February 20, 2014 Share Posted February 20, 2014 (edited) The message means the Apache service is installed. That is not an error message. You need to continue with my instructions for configuring Apache with PHP. Edited February 20, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469725 Share on other sites More sharing options...
yshua Posted February 20, 2014 Author Share Posted February 20, 2014 All right. Will do. Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469760 Share on other sites More sharing options...
yshua Posted February 20, 2014 Author Share Posted February 20, 2014 Dear Ch0cu3r: OK, time to confess again.... Put the pc back to factory settings to make sure of a "clean" start. Had everything back and running as of now, 2 hours later. However, this of course got rid of the Visual Server 2012 R2, in whatever former state. In the melee of restarting apps, remembered the Apache 2.4.7 may have been from Apache.org as well! So, am now uninstalling Apache with "httpd -k uninstall." Will once again repeat my attempt to download VS 2012 R2, then reinstall proper Apache2.4.7. Will let you know what happens. Thanks very much, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469777 Share on other sites More sharing options...
yshua Posted February 21, 2014 Author Share Posted February 21, 2014 Dear Ch0cu3r: Here is the update: Am unsure whether the Visual Server 2012 /R2 needs to be installed yet. Tried to find out how without success yet. At any rate, whether the "ssl" or regular Apache 2.4.7 from Apachelounge.com is used, am unable to get, "It works." Do you need more info from me? Sincerely, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469807 Share on other sites More sharing options...
mac_gyver Posted February 21, 2014 Share Posted February 21, 2014 the Visual Server has nothing to do with apache/php. you need to slow way down and start with what operating system you are going to be doing this on and how many concurrent users you are going to support (the non-server and non-pro versions of MS operating systems limit the number of concurrent tcp/ip connections.). if you are using higher than winXP, you should be using the latest of everything, which would be the VC11 versions of apache and php along with the VC11 version of the Visual C++ Redistributable package (which as mentioned in the reply in your other thread, is free.) Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469810 Share on other sites More sharing options...
yshua Posted February 21, 2014 Author Share Posted February 21, 2014 Dear mac_gyver: Am using Windows 8/8.1. Am currently downloading Redistributable C++ files for Visual Server 2012. Will likely only have about five users at a time on one server. But will be employing MySQL 5.1 at this time as well. These are the 2012 applications run...: wdexpress_full application VS2012_WebExp_enu disk image file VS2012_WDX_ENU disk image file VS2012.4 application vs_ultimate_download application vs_ultimate application vs_professional application vns_full application TypeScriptSetup.0.9.5 HTM file TypeScriptSetup.0.9.5 application PowerPivot_for_Excel_x86 Windows Installer patch_KB2781514 update vs_professional_download application Hope these are sufficient, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469876 Share on other sites More sharing options...
yshua Posted February 21, 2014 Author Share Posted February 21, 2014 Dear mac_gyver: Oh, and still need x86 because of a few compilers using win32 for my limited applications. Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469877 Share on other sites More sharing options...
mac_gyver Posted February 21, 2014 Share Posted February 21, 2014 (edited) that list of applications has nothing to do with apache/php, the subject of the recent threads you have started on this forum. are you sure you even need apache/php and if you do, you need to stick to one subject and one problem at a time when asking for help in a forum. Edited February 21, 2014 by mac_gyver Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1469879 Share on other sites More sharing options...
Solution yshua Posted February 23, 2014 Author Solution Share Posted February 23, 2014 Dear mac_gyver and Ch0cu3r: OK, will comply 100%, even for dumping the package (compiler) my programs are written in!!!! Now installed MySQL 5.5.36, latest reliable offered on MySQL site, along with the latest V11 Apache 2.4.7 and PHP5.5.9 VC11. MySQL and Apache are fine with all the above mentioned 2012 R2 30 day trial version packages above uninstalled and only vcredist_x64.exe and vcredist_x86.exe of Microsoft Visual C++ 2012 Redistributable files installed. Here some other files from those redistributable ones might need installing as well. do you think?? At any rate, Apache returns "It Works!" but when the php5apache2_4.dll logic is included, "Waiting for localhost," goes on on the websbrowser tab indefinitely.... Would more Visual C++ Redistributable package files downloaded do the trick? Ready for the bare truth, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1470305 Share on other sites More sharing options...
yshua Posted February 23, 2014 Author Share Posted February 23, 2014 Dear mac_gyver and Ch0cu3r: OK, will comply 100%, even for dumping the package (compiler) my programs are written in!!!! Now installed MySQL 5.5.36, latest reliable offered on MySQL site, along with the latest V11 Apache 2.4.7 and PHP5.5.9 VC11. MySQL and Apache are fine with all the above mentioned 2012 R2 30 day trial version packages above uninstalled and only vcredist_x64.exe and vcredist_x86.exe of Microsoft Visual C++ 2012 Redistributable files installed. Here some other files from those redistributable ones might need installing as well. do you think?? At any rate, Apache returns "It Works!" but when the php5apache2_4.dll logic is included, "Waiting for localhost," goes on on the websbrowser tab indefinitely.... Would more Visual C++ Redistributable package files downloaded do the trick? Ready for the bare truth, Yshua Quote Link to comment https://forums.phpfreaks.com/topic/286124-put-php5apache2_2dll-in-folders-but-error-says-otherwise/#findComment-1470308 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.