Corrupted file on some instances on Azure with php - php

We're currently banging our heads against the wall with our Azure setup. It might be us who lack skills, but we cannot figure out how to run our instances more smoothly. We run PHP 5.6 w. wincache on Azure. We have multiple instances, which share most of the files. However, it appears that the PHP cache is not shared, and some times when we deploy some files will magically be corrupt. For example a syntax error in a file which should not have a syntax error. This results in our platform throwing up, because, well syntax error in a file.
The only way to fix this appears to be a hard restart of our services, which takes time both in terms of the restart and warming the cache. We are trying to move away from the PHP setup, but unfortunately it's what we have currently.
Is there anyway to flush the system or specific instances without having to restart everything? It's kind of a ball toss if our release goes well or has loads of issues, which in turn makes us more hesitant to release.

Related

PHP 5.5.9 test failures and Internal Server Errors

Firstly forgive me if my terminology isn't entirely accurate. I have only limited knowledge on this subject, but will best try to convey the problems we are having. My server administrator is trying to deploy php 5.5.9 on a live server. Originally the intention was to install php 5.4.x, but we opted for the latest version instead (a manual compile is required regardless due to the o/s)
The O/S is OpenSuse 12.1 and the server is a Plesk server (Plesk Version 11.0.9) with Apache 2.2.1. This particular o/s does not have the ability to update php automatically so everything has to be done manually. Since we didn't want to risk screwing up the server (currently running with php 5.3.8), we opted to install a second version of php alongside the current one. The instructions we followed are outlined here: http://kb.parallels.com/en/114753
After numerous failed attempts due to missing libraries during compilation, we were finally able to compile php 5.5.9 without error and then proceeded to run tests with 'make test'
Unfortunately, the test results came back with 32 failures and 20% of the total tests were skipped. A total of 13011 tests were done, 10410 of which were completed. The TEST SUMMARY can be downloaded from here: http://uploaded.net/file/v6ug55l8
Anyway, deciding we might aswell give it a try, we applied the changes as indicated in the first link above to the vhost.conf. However, it didn't work, and the vhost then returned Internal Server Errors for every page regardless of script or extension. The errors logs sadly do not indicate any errors, only a whole ton of internal server errors recorded by mod_security. We did notice a huge number of these in the error log: Warning: SuexecUserGroup directive requires SUEXEC wrapper. But, it doesn't seem to be related, as the same error goes back several weeks.
So, we're stuck without any idea what to do next. Our next attempt will be to try and compile a php 5.4.x instead, as perhaps something is bumping heads with 5.5.9...
Any and all advice will be appreciated. As per the opening statement, I'm not an expert here, so if you need any additional information about the machine and it's server, feel free to ask. Thankyou for your attention!
Problem solved. The vhost's CGI-BIN needed to be CHMOD 755 and not 775.

APC is corrupting output

I've recently switched my web server to Centos 6.3, with apache 2.2.15, PHP 5.4.11 and APC 3.1.14.
I started receiving complaints from customers from time to time, that a page is not working, or strange errors appear. I saw that the affected pages have question marks and other strange symbols in random places in the output, even though the sources are OK. When I change a single letter in the source file, the page starts working fine.
I suspect APC, but I cannot find any clue when and why this happens.
I use mercurial to push changes to production, but I've used this approach for years with no problem. Maybe something in the configuration is new now, but sadly I don't keep my old configuration.
Below is a screenshot from the last corruption.
Edit: Here's the response after I've changed a single character in the source, saved it, and then undo the files (same is if I just restart the web server or clear APC opcode cache):
Notice the line numbers didn't match, but it's 100% the same request, so the response should be the same also. The line 111 from the first screenshot should not be there at all. It seems that it's from another source file...
I've changed apc.stat_ctime to 1
Verification with ctime will avoid problems caused by programs such as svn or rsync by making sure inodes haven't changed since the last stat. APC will normally only check mtime.
I'll be watching closely on the problem, because it's occurring once or twice a week and post here if this fixed it.

could add GD support to php interrupt a website services?

For one website, I need to add a litle script who resize images in php. For that, I used the GD functions. That worked very well in the dev machine, the problem is that in production doesn't work because php GD support isn't installed.
The things is, I'am not expert in server configurations and maintenance (my experience is mostly develop, and in others jobs other people were in charge of the servers, but this company is very small, so...), and I have a little fear that, if simple I install php-gd support, something wrong could happens to the productions server.
Any advice would be greatly appreciate.
While there is the possibility of something going wrong during the install, this can be mitigated by backups. Only thing I could imagine on the php side is concerning method definition - if somebody defined a method with the exact same name of a predefined mod_gd one, it will break.
If you want to be really sure: get a full backup of the production server, install it in a VM and test adding the GD support to it. If it doesn't break the VM install, it won't break the production server either.

What apache modules are required?

How can I determine what add-ons to apache will be required for my php code? I have legacy php code that was setup a long time back (and we dont have the documentation on what was done at that time). I need to get this application working on another new server, but apache has yet to be installed.
I would like to install only those components which are necessary.
a php module, pal
to run php code you need mod_php installed. That's it.
if you're talking of PHP extensions, that's another matter and it's hard do tell.
I'd make it this way: log all errors and watch for "undefined function" ones. And turn appropriate extensions on.
It have to be done anyway.
Legacy code being run on fresh PHP installations usually flood your logs with errors.

PHP has encountered an Access Violation at 77FCAFF8

I am running a PHP site that uses Ajax and jQuery as well. The site will run fine for quite some time, and suddently my pages (and ajax-retrieved sub-pages) comes back with the message
PHP has encountered an Access Violation at 77FCAFF8
It seems that rebooting the server corrects the issue. Running PHP Version 5.1.6 (Windows NT 5.0 build 2195). I did a some searching on here and some other sites, and there seems to be no fix..
URL REMOVED
UPDATE:
I think I'm on to something.. will get back to you.
UPDATE
After reviewing the IIS setup, i noticed there was no Handler Mapping setup for the website. This, of course begs the question - how did it ever work in the first place, when it was originally setup this way!? I added the handler mapping and it seems to be Okay so far.
UPDATE
The problem popped its heads out again this morning after 36 hours without encounering it. Back to the drawing board.
UPDATE
We ended up just moving the site to a secondary web server where we were able to upgrade PHP without an issue.
This is a PHP issue somewhere. You could spend some time narrowing down which function you're using that is causing the problem. I would instead upgrade to a newer version of PHP. If still no luck, try a slightly older version. There have been significant changes with version 5.3.2.
After some research I think this may be the solution (Taken from http://bugs.php.net/bug.php?id=28929 ):
[2010-06-11 15:12 UTC] in2ishun at yahoo dot com
***************** SOLUTION!!!!
I realize this issue is AGES old, but it still manages to be the top hit on Google searches as of now (6/2010).
I fixed my own instance of seeing this error. W2k3, IIS6, PHP 5.2.6, MySQL 5.1.
The problem is in the pathing. When I used the MSI installer for MySQL without doing an "advanced" installation (where I could manage the install details), it added a path to the system environment that contained spaces. Even after changing the path environment to use the Windows short-name location of the mysql bin directory, it still didn't work.
The solution was for me to reinstall mysql and set the default installation path to just off the root (e.g. C:\mysql). Once I did that the error went away and my app started working.
There are a number of sites with a variety of potential solutions to this issue and several of them mentioned paths and the "libmysql.dll" file (in the "bin" directory of your mysql installation).
If this helps you solve your problem, consider leaving a comment here so others can see that it works.

Categories