Windows Zend PHP Debugging Environment - php

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

Related

How to view ERROR feedback in AWS PHP application?

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

IIS Error when trying to link the php-cgi.exe file to the PHP Manager extension: 'Operation is not valid due to the current state of the object'

I'm trying to configure a web server with IIS which requires PHP for working. I installed the PHP Manager extension on IIS and by default my server has PHP disabled. So I tried to enable PHP and the Manager asks you to input the path of your php-cgi.exe file. So I did it, added the path to the file and when I click 'Ok' for registering PHP and enabling it, it throws this error:
'There was an error while performing this operation.
Details:
Operation is not valid due to the current state of the object.'
It doesn't show any other information about what's causing it. PHP Manager says that my handler mapping is not available, while in other IIS server that I own in a different computer it says 'inherited'. I dont know if handler mappings are related with this error and I need my website to be running PHP for it to work. If I run the server right now it just throws 500 internal server error when trying to access the web. I'm 100% sure its caused by PHP not working because in my other server I also got 500 internal server error because of an incorrect installation of PHP in the server.
EDIT: I forgot to mention that PHP Manager shows that PHP is enabled and working in the server general configuration, but this error I mentioned above happens only on one of the websites of the server.
I tried to reproduce the issue but it only reproduce once. Something wrong make register php failed. It can be fixed by register all php again. Please follow these steps.
Click the FastCGI Setting at server level and remove all items which
full path points to php-cgi.exe.
Click the Handler Mappings at server level and remove all items
which path is *.php.
Choose the site which you deploy php
application. At site level, click the Handler Mapping and click the
Revert To Parent.
Click the php manager at server level and register new php version.
Note:IIS only supports versions of php which can be download from Web PI. Please download php from Web PI, not download it from site manually.

Diagnosing "The connection to localhost was interrupted"

I've been developing a Laravel 4 site on my work machine for over a year. Today I began receiving a The connection to localhost was interrupted error whenever I attempt to access the site. At the moment I'm just trying to find applicable log files that might tell me what's failing, and would appreciate suggestions from those more versed in tracking down this kind of failure. You'll see one possible cause below, but I still need to find some error logs to have any idea how to fix it. Here are some pertinent details:
I'm running Windows 7, IIS 7.5, PHP 5.5.1, and Laravel 4.1.23.
The application is accessed via https://localhost/ephy, and IIS is configured to deliver the ephy directory over SSL.
http://localhost/ephy correctly returns a 403 error indicating that the page must be accessed over SSL.
When copies of phpinfo.php (containing just a call to phpinfo() ) are placed in both the root directory and the ephy subdirectory, http://localhost/phpinfo.php executes, while https://localhost/ephy/phpinfo.php returns the connection reset error.
The application itself is executing successfully on the production server, so the PHP code is valid.
Yesterday I installed Office 2013, uninstalled Office 2010, uninstalled Office 2013, and then reinstalled Office 2013 (in that order). I also installed 2 GB of memory, because Outlook 2013 kept hanging.
The site was accessible as of 4pm yesterday, after all of that installation activity was already over.
I've made no changes to the application or the computer configuration since 4pm.
I've restarted the computer several times.
I've checked the files in C:\inetpub\logs\LogFiles , but they don't show any error messages.
So, I know PHP is running successfully and that the issue is specific to serving the application directory itself, but that's as far as I've been able to get. Recommendations on where to find (or how to generate) logs which would indicate what's happening, or any insights into the failure itself, would be appreciated.
Ok, after finally finding the magic combination of search terms on Google (ERR_CONNECTION_RESET localhost iis 7, for those who are curious, the first term being the error message from Chrome specifically), I was able to determine that this behavior can be caused by not having the self-signed security certificate correctly bound to the site in IIS. As I said, the site had been working successfully, but with the software updates I'd done something probably got borked (maybe adding the memory changed the computer's identity such that the certificate was no longer valid? I don't know).
So, I followed the instructions at http://weblogs.asp.net/scottgu/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates (with a bit of adjustment because apparently the binding has to be done at the default site level in IIS 7.5, rather than at the individual site level), whacking and replacing the existing certificate and SSL binding in the process. The site is now working again on my box.
So, in a nutshell: if you're running SSL on localhost under IIS and you get "connection to localhost was interrupted" messages, try redoing the certificate and binding.
Man, glad that's over...

Debugging IIS 7 errors on shared hosting

I have a few Drupal sites (PHP) around on Windows shared hosting. I frequently run into IIS 7 errors when re-installing an entire site at which point I'm totally stuck. Then I have to open a support ticket with my hosting provider which takes a while to get resolved (a couple of hours) and the never tell me what they did to fix it. I'm looking for more resources or checklists to narrow things down and try to resolve the issues myself (and don't lose hours).
The errors most often contain these bits:
Module: FastCgiModule
Notification: ExecuteRequestHandler
Handler: PHP_via_FastCGI
There's also an error code but usually that's just 0 (0x00000000).
I only have access by FTP and and a web administration tool (WebSitePanel if it makes any difference). Most of the time uploading a testpage which dumps phpinfo() does work so I have more info available...
There is no way for you in WebsitePanel to get more information about an exact problem. Your web hosting provider may need to check server logs -> Application logs from their server and find out root cause of this problem.

Debugging 500 Internal Server Error on PHP running on IIS7 cluster

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.

Categories