Page 1 of 1
[SOLVED]php.exe causing out of memory errors
Posted: Thu Aug 19, 2004 6:17 am
by hellsgate
Lo there. I'm running php version 4.3.7 on Windows 2000 Pro and IIS 5.0. Up until yesterday, everything was running fine, hunky-dory even. However, while testing pages on the localhost, I started getting out of memory errors where the page file was full up. After having a look, I discovered it was php.exe that was causing this by taking over huge amounts of memory resources as soon as it started up.
I've tried re-installing php onto my machine. I've tried uninstalling and re-installing IIS. I've tried re-installing Windows and I've also tried the drastic measure of formatting C:\ and installing everything from scratch. None of these have fixed the problem. I'm still running the same php.ini as I was when everything was going OK.
Just in case you need this info, I have 512 MB of physical memory, and my paging file is set to min - 768 max - 1502 on a different drive from my OS. Thanks for reading.
Hellsgate
Posted: Tue Aug 24, 2004 10:17 am
by liljester
it looks like you are using the cgi install (php.exe) instead of php4isapi.dll try this install:
Installation of IIS, PHP and mySQL on Windows 2000
1. IIS Installation
1. Click the Start Button, Click “Settings”, Click “Control Panel”
2. Double-Click “Add/Remove Programs”
3. Click “Add/Remove Windows Components” to start the Windows Component Wizard
4. Click “Internet Information Services (IIS)”, be sure not to check the checkbox, as that will install all services, and the SMTP service if left unconfigured will be an OPEN SMPT RELAY
5. Click the “Details” button
6. In the IIS Details Window, check the World Wide Web Server (“Common Files” and “Internet Information Services Snap-in” are checked automatically)
7. Click “Ok”
8. Click “Next”
9. Insert Windows 2000 CD as needed
10. Once the Windows Component Wizard is complete, Click “Finish”
11. Test your webserver by opening up Internet Explorer. Enter “127.0.0.1” in the address bar and hit the “Enter” key. If you are doing the test from the webserver you will see a page stating “You do not currently have a default document set for your users. Any users attempting to connect to this site are currently receiving an "Under Construction page".” Anyone else trying to connect to your webserver via external IP would see a default “Under Construction” Page.
You have now have a windows 2000 Webserver… and its probably already compromised, so go out and get those updates/service packs!
2. PHP Installation
note: this document is for use of the zip package only, *not* the installer package.
1. Download the Zip Package from php.net
2. Extract the contents of the zip file to C:\
3. Open Windows Explorer, or double-click My Computer. Browse to Local Disk C: and you should have a folder called “php-4.x.x-Win32” or the like. Rename this folder to “php” for the sake of simplicity.
4. Copy “php4ts.dll” from the “C:\php\” folder to “C:\Winnt\system32\”
5. Open the “C:\php\sapi”” folder and copy “php4isapi.dll” to the “C:\Winnt\system32\” folder
6. Open the “C:\php\extensions\” folder and copy the extensions you want php to use to the “C:\Winnt\system32\” folder *this step is not necessary, but may prevent confusion later*
7. Open the “C:\php\php.ini-dist” file and tweak it to fit your needs. Make the following change in the “File Uploads” section: “upload_tmp_dir = /webtemp”. In the “Session” Section make the following change: “session.save_path = /webtemp”
8. When all your configuration is done, save the file as “php.ini” in the “C:\Winnt\” folder
9. Create a folder named “webtemp” on C:\
10. Open the Internet Services Manager. If you are using Windows 2000 Server: Start > Programs > Administrative Tools > Internet Services Manager). If you are using Windows 2000: Start > Settings > Control Panel > Administrative Tools > Internet Services Manager.
11. In tree, double click <computer name> to expand the services running on your server
12. Right-click “Default Website”, click “Properties”
13. Click the “Home Directory” Tab
14. Under Application Settings, change “Execute Permissions” to “Scripts and Executables” then click the “Configuration” button
15. Click the “Add” button
16. Click “Browse”, change “files of type” to “Dynamic linked libraries (*.dll). Now browse to the “C:\Winnt\system32\” folder and click “php4isapi.dll”, click the “Open” button
17. Enter “.php” into the “Extension” Box
18. Click “Ok”
19. Click “Ok”
20. Click on the “Documents” Tab
21. Click “Add”, enter “index.php” and click “Ok”.
22. Click “index.php” and using the up button, move it to the top of the list. *You may also want to add “index.html” to the list
23. Click “Ok”
24. If prompted again Click “Ok”
25. Close the Internet Services Manager, and any remaining windows.
26. Open Wordpad, and enter “<?php phpinfo(); ?>”. Save the file as “index.php” in the “C:\inetpub\wwwroot\” folder.
27. Open up Internet Explorer, and enter “127.0.0.1” into the address bar and hit the enter key. With any luck, you should see a page full of info about your php settings.
You server is now configured to run PHP. Wheee.
! On windows 2003 server you must additionally configure a PHP “Web Service Extension”.
1. Click “Web Service Extensions”.
2. Click “Add new Web service extension…”.
3. In the “Extension Name” field, type “PHP”.
4. In the “Required Files section”, click “Add”.
5. Click “Browse” and locate “php4isapi.dll” in system32 folder.
6. Follow step 4. and 5. for “php4ts.dll” file also in system32 folder.
7. Check the “Set extension status to Allowed” option.
8. Click OK.
You should now have a PHP web service extension with a green checkmark on it.
3. mySQL Installation
1. Download, Unzip, and Install mySQL to the default directory (“C:\mysql\”)
2. Right-click “My Computer” and click “Properties”
3. Click the “Advanced” Tab
4. Click the “Environment Variables” button
5. In the “System Variables” box, click on the “Path” variable, then click the “Edit” button
6. In the “Variable Value” box, add “;C:\mysql\bin” to the *end* of the text that is already there
7. Click Ok
8. Click Ok
9. Click Ok
10. Open a command window
11. Type “mysqld-nt –install” and hit the Enter key to install mysql as a service
12. Type “net start mysql” and hit the Enter key to start the service (“net stop mysql” stops the service)
13. Close the command window
mySQL is now installed and waiting to be used. Some people use the Mysql Manager.exe… I haven’t found a real use for it yet, since I prefer the command line or PHPmyAdmin =P
*sorry for the big post, its a copy and past from a doc i made a year or so ago*
Posted: Fri Aug 27, 2004 3:07 am
by hellsgate
liljester, you're a life saver. I ran thru this and PHP has been behaving itself properly. Thank you very, very much.