I need to install large sites locally on two developers workstations. The sites are written in php5 with parts in Zend 1.10 and the database is MySQL. The production server runs on windows server 2003 . The sites are already running on windows vista on a development station and on windows 7 on another one.
On two workstations where i have to install (a windows xp and a windows 7), the same strange phenomenon occurs: after a few successfull requests apache freezes and no longer responds to any query. The site does not work until a reboot of Apache that takes quite a long time (> 30 seconds) . There is nothing in Windows Event Viewer or in the apache logs. Handle.exe tells me nothing and even freezes when apache starts to hang. Windows tasks manager shows nothing unusual. I have compared the host file , php.ini , httpd.conf and httpd.vhost.conf with stations that work without finding any difference.
The configuration includes mod_rewrite , mod_proxy , apc , memcached. Apache version is 2.2 and PHP 5.3.x (thread safe). The code is under version control, database and data directories are synchronized.
Not familiar with windows , I'm looking for tools or assumptions to solve this problem .
I provide some information about a temporary solution I applied. I noticed that a fraction of the php code was executed before Apache freezes.
Execution stops within a Zend Class, Zend_Validate_Ip in the setOptions method. At this time, the file is locked for writing and held by httpd.exe.
I found that this file was slightly different from the original version (Zend 1.11.11) : the require_once have been removed. This is an acceptable optimization recommended by the official documentation.
However, restoring the require_once in that file, the problem is solved. Apache no longer freezes and everything works. So there must be a problem with class loading but I do not understand exactly what it is.
Related
I had installed php and mysql on Windows Server 2003 Web edition many years ago. The hard drive crashed on December 23rd, 2021, and although I had all our data backed up, I did not have a system backup to save the OS and all configurations/installations. I have php scripts to bridge Adobe Air and mysql, so I have to stick with php.
Installing PHP 5.3 on IIS6, as was what was running before. The installation with FastCGI is straight forward and fairly simple to get php running, but I am stuck. After following the dozen or so "how-to" guides floating around the web, I am left with the same issue no matter what I try.
When running php.exe from the command line, I get "Access is denied"
I changed security of C:\PHP to allow full control for all users.
I changed the application pool identity to local system from network service.
I double-checked the .ini configs for php.ini and fcgiext.ini.
I believe every location for path variables has been updated/set properly.
At this point, I'm leaning toward something in IIS or Windows blocking access, but I have run out of ideas/options. A new server is being ordered, but we need to get this one up and running so we can limp along until we have new hardware/software to install our programs on.
Any help would be greatly appreciated.
This might be a long shot but have you tried to check that the .exe isn't set to "Read-Only" also you can try take ownership of the folder with the following:
Take Ownership on Right Click
I have a PHP 5.3.22 windows server running PHP in fastCGI. It's a Windows Server 2012 but I have also tried this on a Windows Server 2003 box so it does not seem IIS version specific.
If I have a basic PHP page:
<?php
echo 'test';
?>
Why does this take 1 second to load? This overhead seems to stack with further AJAX requests to PHP so this 1 second seems to be adding up.
Basic HTML pages just containing a word "test" from the same server is near instantaneously.
Surly it can’t just be that it takes servers a second to realise this is a PHP file and to prepare PHP for code execution.
I have tried setting the application pool to have more worker processes and to have it’s start mode as “AlwaysRunning” instead of “OnDemand” but alas this seems to have no impact.
Unfortunately changing the PHP version is not an option at this time (would take too long testing, etc).
If it's a clean start, then you shouldn't be experiencing delays anything like that. Perhaps check if you have any plugins or similar running. Xdebug slows down executions, for example.
I started trying to create a website which uses PHP on an old computer (previously used by another programmer).
I wanted to test my PHP code without uploading it each time, so I downloaded Apache and installed it. I was starting to set Apache up when I discovered this computer already had Apache on it.
Now I had multiple versions of Apache, so I went into add/remove programs and got rid of Apache (which only showed up once in the list).
Unfortunately windows decided it would uninstall the old version and keep mine which was not functioning properly. Also for whatever reason it seemed to have kept a good few files from the old version, but not enough that I could actually use it in any way. I believe it just had some configurations files.
I thought I would copy my files from the new version into the old version and not replace anything so hopefully I would be able to run under the older configurations, but that didn't work.
At this point I just wanted to cut my losses, so I put all the versions of Apache in an archive so there was no way the computer could be using them. I also removed Apache from the windows startup and rebooted the computer after configuring one single version of the newer copy of Apache to supposedly run PHP.
The problem is upon startup I could immediately log in to localhost and apache was already running. Also when I opened Apache manually from the files I had left unzipped, it only gives me the option to start Apache (not an option to stop or restart implying it is not running) and when I click it, it says "The requested operation has failed!" which is less than helpful.
So anyway, I just want to be able to run PHP locally and now I don't feel like I can even successfully uninstall and start from scratch anymore. Does anyone know what I have to do to get this to work? Sorry for the long description, I wove such a tangled knot.
One way to solve is use a XAMP (Apache + MySQL + PHP) client like XAMPP http://www.apachefriends.org/en/xampp.html brings it all set up for you to use. The problem of conflict can be caused by any IDE (Netbeans for example) that already carries a version of Apache.
Try to configure config files of Apache case exist.
Assumption: Running Windows OS for development and linux for production environment.
My recommendation is to not mix the Windows and Linux worlds as while they can be made to behave after lots of work, it is usually more pain than good.
Instead, as a humble windows and linux user, download and install Virtualbox [https://www.virtualbox.org/wiki/Downloads], a free open source virtualisation tool.
Then download a linux distribution of your choice and install that into a new virtual machine.
Configure the linux tools inside linux and leave your windows machine relatively untouched.
A useful linux service to install would be Samba - windows file sharing - you can use this to edit your code in windows using any IDE of your choice, while saving directly to linux and testing through linux. When happy, upload from the linux system (again like any other file uploader) and all will be well.
If you are deploying to a linux based environment in your production service then this will help you avoid common mistakes such as case-sensitivity trouble and many others.
Building and running this system is free and it will help teach you more about the linux environment you are deploying to also.
Equally, when you don't have the virtual machine booted, there's no services lying around exposing your computer to possible local network threats and consuming resources - as opposed to installing Apache on Windows where it will be using some resources all the time.
I run simpleSamlPHP 1.9 on a PHP 5.3.9 installation in EasyPHP, on a Windows XP machine. SimpleSamlPHP is serving as a SAML identity provider, fetching users in a local MySQL database.
My problem is that when requesting authentication against this IdP, Apache crashes throwing a "violation access" error, a.k.a. segfault. The problem is similar to this thread except that the child process exits with status 0 (but isn't this a Windows-specific feature of PHP regarding exit codes ?).
The common fix, copying libmysql.dll and php5apache2.dll in C:\Windows\system32, doesn't help.
Running VC++6 just-in-time debugger doesn't give me any information about which module is incriminated :'(
I tried to disable as much PHP extensions as I could. SimpleSamlPHP needs openSSL and PDO/MySQL, thus I kept only those 2 enabled, and crash happens anyway. I checked separately that using openSSL and MySQL works fine.
Finally I have to precise that the machine hosts 3 instances of PHP, including 2 in EasyPHP (2 separate installs), but only the concerned instance is active when the crash happens.
Any leads ?
Cheers
Did you run php with apache's mod_php? I had the same situation here. It always crashes when a sp authentication comes in. I have no idea how this happened. But at the end, I avoided the problem by running php in FastCGI mode.
I had difficulty finding the newest version of php_apc.dll so I went ahead and compiled it myself. I had no issue getting it compiled using NTS v5.3.8. I had two separate files set up to test, one with a simple phpinfo() call on it and the other being the standard apc.php file that comes with the apc source files.
Strangely, when I would load the phpinfo() file it would work totally fine, but when I tried to access apc.php the webserver would hang until a timeout. I restarted the webserver, accessed apc.php and it worked just fine, but trying to go back to phpinfo() would cause the server to hang until timeout. It is probably worth noting that phpmyadmin and my own codeigniter application do not work period, even after a restart.
I have tried previous versions of apc with no luck; 5.3.5 with apc.stat = 0 works but I am in need of that feature as this is a development server, but I'm testing out some production type caching.
Noteworthy stuff:
Server is powered by Nginx 1.0.8 running PHP 5.3.8 (using fast-cgi). Everything works as intended with the exception of when apc is loaded.
You can download the php_apc.dll from http://downloads.php.net/pierre/
You can find there different versions of it.