Recently my ISP switched our website to an IIS7.0 high availibility cluster. The website is running on PHP5.2.1 and I can only upload files (so no registry tweaks). I had tested the website before and everything seemed to be working, but now the checkout page fails with:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
As error messages go, this isn't very informative. I've tried:
ini_set('display_errors', 1);
ini_set('error_log', $file_php_can_write_to );
but both don't seem to do anything.
Anyone know how to get better debugging output?
Edit : Looks like we have a similar question in serverfault. Check it out
Turning off IIS7 custom errors will allow error responses from your application to be sent to remote clients without being censored by the IIS7’s custom errors module.
You can do this from the IIS7 Admin tool by running “Start>Run>inetmgr.exe”, selecting your website/application/virtual directory in the left-hand tree view, clicking on the “Error Pages” icon, clicking “Edit Feature Settings” action, and then selecting “Detailed Errors”
Source
It's very common when you change server you cannot load your apps. I have solved this problem running php.exe instead of loading your apps on the browser:
1) Run it using the Command line > C:\php\php.exe OR
2) Run Windows Explorer, look for it, and double click on c:\php\php.exe.
3) You are gonna see what DLL's are having conflicts and causing the 500 error.
4) Solve the conflicts finding the right DLL's for your windows version and you should be able to see your apps through the browser.
The best of the lucks.
IIS does this, it's really annoying and I could not find a fix, which is what caused me to switch to an Apache server for my local machine. Unfortunately, if you don't have control over your server, the best you can do is either test it locally on an apache set up or ask your host to allow the error messages.
I did some googling, thisthis looks like what you need. Wish that was around when I was trying to get IIS running.
Related
I am currently developing a web application using AWS services and it's written in PHP. Previously, I used XAMPP to do the work, but now I use EC2 and RDS (MySQL) of AWS. And I also hosted the web on domain using Route 53 and it is secure with Certificate Manager (HTTPS enabled).
This is how I do my job. Sublime Text to write code, then copy paste the file from local to server using WinSCP. If nothing wrong, the code will instantly reflect in my webpage. However, unlike XAMPP, the ERROR will reflect exactly which line is going wrong. The approach I am using will only show HTTP 500 (Request cannot be handled) within the webpage.
For now, I have to test code by code to find the ERROR and it's a waste of time. So, if I want to view which part is going wrong like XAMPP, how can I do so?
Thank you.
In a production environment, it is recommended to switch off detailed errors so that your implementation details are not exposed. Sounds like this is the problem you're facing with the new setup. You need to enable this in your php.ini file, and you might want to look into your .htaccess as well.
Check out the answer here for a more detailed explanation - How can I make PHP display the error instead of giving me 500 Internal Server Error
Here's a guide on implementing the changes you need - https://stackify.com/display-php-errors/
By default, the Errors logs are stored at /var/log/apache2/error.log. So you can do something like the below to see the apache logs in real-time:
tail -f /var/log/apache2/error.log
I have two servers, a test server running Windows 7... and a prod server running Windows Server 2008. (Yeah, it's unfortunate that they're different OS's.)
For months now, they've been running on PHP 5.4.1.4.
I decided to upgrade them to PHP 7. Everything went completely fine with the test box. But of course, it doesn't get much traffic.
On the prod / Windows Server 2008 box, it seems like, web apps would run for a minute or two and then show "500 error". I could refresh and sometimes they'd work again, sometime it'd take a few minutes.
Nothing is/was getting written to the NEW PHP error log (even though IIS's PHP Manager section showed that we were pointed to the correct INI and the correct log file).
The webserver failed request logs simply indicated that FastCGI was failing because of too many 500 errors.
I checked Event Viewer and I would see application crashes that would point to php_soap.dll.
Now, that file is THERE and it's the same size as the one I have over in non-prod.
Still, I thought perhaps it was because my scripts were getting 500 errors for a valid reason. So I investigated one of them. Confirmed that it was an exact match to a working one on the test box. Refreshed it...and it worked fine. Refreshed some more, 500 errors.
So, finally, I went into IIS Manager -> PHP Manager and disabled the SOAP extension.
I then STOPPED seeing the massive number of failed requests and I stopped seeing the 500 errors... for everything except the one script I have that makes SOAP calls.
I tried copying the dll from the test box over to the prod box. Enabled the extension again in PHP. The issue returned. So, I've pointed us back to the 5.4.1.4 config for now.
Any ideas on how I might figure out why this dll is causing issues and/or how to fix it?
Thanks!
-= Dave =-
I know this is old now but I had a similar problem and it turns out that the cached WDSL files are not binary compatible between versions of PHP.
By default in php.ini the SOAP module has caching enabled. In order to avoid a crash you'll either need to clear the current WDSL cache or change the cache location for the new PHP install.
Hope that helps...
I think I figured out a fix. I'm not sure why I'm only having to do this on the prod server, though: The directories that my scripts that make SOAP calls are in were set to allow both Anonymous Authentication and Windows Authentication. When I was manually testing things in my browser, it would accept me and run the script as Anonymous.
I suddenly realized a theory: my erroring script was being called by remote desktop gadgets...so it was probably defaulting too to executing anonymously. But I have another script with SOAP in it that's run by Scheduled Task (as a specific user). I had NOT seen that erroring!
So, I turned off Anonymous Authentication on the directory I was testing and reran my script from my browser. Sure, I had to log in, but it then worked! I checked my version of the Desktop Gadget that calls a SOAP script in that same directory...and it was now working too!
I think the key reason why I did not see this on the test machine is that we really don't have any Desktop Gadgets pointed to those proxy SOAP scripts over there. That, plus I had THOUGHT that my script that runs by Scheduled Task was failing on the prod machine, as I know I saw it throw 500 errors within the first few minutes after I activated PHP7 the first time....and that same Scheduled Task/script DOES run over on the test box.
Thanks!
Recent projects (Shopware, xt:Commerce) contain ioncube-encoded files which force me to use the ioncube_loader extension. Loading this along with the ZendDebugger does work unless I try start debugging. Once the loader is included, debugging doesn't work anymore - even in non-encoded environment (for one Joomla).
System: Windows 7, Zend Studio 10.6, Zend Server CE, Zend Debugger, ioncubeLoader, PHP 5.3+
I already spend several days searching for a working solution (except using inline debug commands). If it means, setting up a unix environment, so be it. But there seem to be problems, too.
Windows Event Log shows an Application Error (1000):
Faulting application: php-cgi.exe, Version: 5.3.14.0
Faulting module: php5.dll, Version: 5.3.14.0
exception code: 0xc0000005
fault offset: 0x00084494
path to ZendServer php-cgi.exe and php5.dll respectively]
Instead of starting a debug session, a download dialog pops up, containg that HTML code
OK
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin#example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additonally, the ZendEnabler.logs shows:
[timestamp] Error: Read data error - unable to get read result. Code 109.<br />
[timestamp] Error: Request for D:/Projects/Joomla3/index.php: Unable to get the response from PHP process
The joomla folder is mapped to a local virtual host http://joomla3.localhost environment and the subdomain added to the hosts file. No problem if i don't start debugging.
Any help is greatly appreciated ;-)
Just ideas
This could be something as stupid as a line ending incompatibility.
Could be a file* permission, php creating files as the wrong user or with wrong privileges.
Try running the system with elevated permissions? !!Caution, permission elevation is an awful solution.!!
Could be a Windows shell association, or content type dispatch issue.
Have you tried reaching out to IonCube's support? They appear to be a commercial product from the top google hit, they should offer support in some manner.
Try Virtualization? Setup a ubuntu or other virtualbox and test functionality in there?
Thats all that comes to mind looking at different parts of your problem. :\ Home something helps.
To resolve this behavior, correct the DNS address in the Internet Protocol (IP) properties:
Right-click My Network Places, and then click Properties.
Right-click Local Area Connection, and then click Properties.
Click Internet Protocol (TCP/IP), and then click Properties.
Type the correct DNS address in the Preferred DNS server box.
Source:
http://support.microsoft.com/kb/261007
I have a joomla GIT repository of my project. We are using wamp and windows 7 as a development environment. This repository works fine on one machine. But when we tried to clone same repository on other two machines, we are facing a strange error.
Error is: Error 0 couldn't connect to host
As shown in screenshot.
All other repositories on those two machines work fine.
There is no error logged in under any of error logs file (apache, php and mysql).
I enabled joomla's error reporting. Searched on Google but, no luck.
Please help.
Thanks.
When you clone your Joomla to another machine, there are several things you need to double check:
Not only the files from the GIT, make sure the database is the same on the other two machines as well (export from the first one, import to 2 other one using phpMyAdmin).
Make sure the configuration.php file on two other machines re-corrected, includes: path to logs, tmp folders; database information (host, username, password, database name).
It should works.
Well, I debugged little bit more and finally found the solution. It was a small issue with missing web service link in one table. We are using com_api for web services. On first machine web service link value in table was local value respective to that machine.
On remaining two machines, we updated this to local value of those respective machines.
And it worked :)
This is not a standard Joomla error - it's either that this error is thrown by an extension or it is a server error.
Try adding a die(); at the beginning of your index.php file and see if it actually dies, if it doesn't, then this is definitely a server error.
If it does die, the use the function: get_included_files() and then make a quick search on all the files included on that page for the sentence "Couldn't connect". You will find the culprit easily this way.
Check your .htaccess file, maybe they have some rule which can not be met. (Rename this file if it exists and see what happening)
But I think that the problem is in the network settings. Errors often come from dns issues or, curl connection restrictions.
Check your DNS records
Check your Curl settings and try to create any Curl request.
Check your .htaccess
I don't think this error related to Joomla , I think it is connection from PHP to Linux, try to change the port of the Linux.
and restart the Apache and try again.
I have a slight problem and cannot for the life of me figure out what is happening. I am running a Linux machine on a server with APC enabled. Everything works fine.
Now when I enable APC on Windows the server starts terminating the connection. You know, the "Site currently unavailable" message Firefox spits out.
I tried the access logs, error logs and there is nothing there to indicate an error. How could APC influence on a server like this?
BTW: I have a CMS on my local server/live server. On the live server it works great with APC. On the dev server the connection terminates. The strange thing is, simpler scripts execute just fine. The CMS is using CakePHP.
Any help would be very appreciated.
I tried the access logs, error logs and there is nothing there to indicate an error.
This is not very helpful - did you check to see if the request is logged at all?
Is every request to the webserver affected? Just the PHP scripts? All the PHP scripts?
My guess would be that you have the wrong version of APC installed or have loaded it along with another opcode cache (e.g. Zend optimizer)
C.