Is there any PHP library for handling exceptions/errors(including fatal) in PHP? It should be very configurable, support log to file, send Emails, and have integration with different browsers console.
the best library I found is Lagger - support FirePHP extension for Firefox and has own extension for Google Chrome console
including fatal
So after PHP has crashed trying to untangle the source code, you want to run more PHP code to identify where it went wrong? This is not possible with PHP code.
I've used ErrorHandler in the past but Whoops is way better. Amazing!
http://filp.github.io/whoops/
http://filp.github.io/whoops/demo/
Related
Has anyone configured VS Code to show syntax/semantic errors in PHP development? Coming from full Visual Studio/C# world, I really miss this thing a lot. Currently I actually have to call my PHP function using a client, only to get a HTTP 500 error and then check server logs to see what went wrong. This is a huge pain. Going through all of this only to find for example that I didn't import a require namespace, is so frustrating.
I understand that PHP by design cannot detect all kinds of errors like C# at compile time (so to speak), but detecting functions that do not exist or not passing required parameters should be easy to catch.
Is there a plug-in or setting in VS Code that could handle syntax/semantic error in PHP code? I'm using Laravel on the server-side, if that matters.
Looks like I found something. I uninstalled PHP Intellisense extension this morning and installed PHP Intelephense and all seems to be far better. Not only that the syntax and semantic errors are highlighted, it automatically injects required namespaces too. And if that were not enough, Go To Definition (F12) command has started working correctly all of a suden. :)
Must-have extension for any PHP work in VSCode I'd say.
I'm looking to create a Google Extension for Chrome. I was wondering if it is possible to include a PHP file in the extension. After reading about extensions on Google's developer portal, they only mentioned HTML, CSS, and JavaScript. Nevertheless, is it possible to use PHP in the extension? Help is greatly appreciated.
No. PHP only runs on the server, while the extensions run in the browser. You can, of course, contact your server, but you can't run PHP inside the browser.
No. Well, you can include a PHP file, but it won't be processed because PHP is run on a server. You can make a function in Javascript to contact a PHP script on your server, however.
The google extensions only support HTML, CSS and Javascript files and
this is what is considered a client, while PHP is a server-side
language.
You can find more about Google Extensions here
https://developer.chrome.com/docs/extensions/mv3/architecture-overview/
I have had to create a web service in PHP for a system I am busy on. I have got it to work using PEAR::Soap on PHP 5.3, but on the logs it gets spammed with errors and notices. I have tried going through the code and fixing the errors, but each time I fix one set of errors, another set appear.
Is there a version which will run without errors? Or an alternative that is just as easy to use?
Any input will be appreciated.
Have you tried http://www.php.net/manual/en/class.soapserver.php
I'd worked with PHP's SoapServer and Client. It works perfectly.
Also you can try Zend_Soap. (Built on PHP's Soap)
You shouldn't need to use the one from PEAR -- PHP has had SOAP client and server classes built in since v5.0.1
See http://uk.php.net/soapclient and http://uk.php.net/soapserver
Hope that helps.
Any work around for this problem?
http://bugs.php.net/bug.php?id=28419
That's not a bug in PHP. The page you linked to says:
The error comes from the c-client
library. We can't do anything about it
so report to the c-client library
author(s) instead
Try updating your c-client/IMAP libraries (and PHP while you're at it -- PHP4 is deprecated)
I'm looking for clean way to break my current habit of using print commands in PHP when I want to see what's happening.
I am aware of options such as Zend Debugger but I use Coda for development and I'm not interested in mixing other software or having to do server commands. I just need a console that can be added to my codebase and then turned on/off.
Does anything like this exist? Furthermore, what do you use and why?
EDIT: There was a lot of stuff out there but I needed something even simpler so I ended up coding it myself. It didn't take long (nor is it very pretty) but I've put it up on my server for anyone else interested.
There is very good extension for Google Chrome - PHP Console.
You can use Xdebug in combination with any one of the many options available to view its debugging info.
There's FirePHP which will write your PHP log messages to the Firebug console.
I am aware of options such as Zend Debugger but I use Coda for development and I'm not interested in mixing other software or having to do server commands. I just need a console that can be added to my codebase and then turned on/off.
Not entirely sure if I understand you there, but couldn't you log to a file and then have a console window running with tail -f /path/to/log-file.txt? That works pretty well for me. Of course, you do need a console connection to the server for this.
Using Coda? That means you are using a mac. You probably want to look at XDebug and http://www.bluestatic.org/software/macgdbp/
There is another extension for Chrome available called ChromePHP. It's a little simpler than some of the other solutions:
https://chrome.google.com/webstore/detail/noaneddfkdjfnfdakjjmocngnfkfehhd
Getting started guide available at:
http://www.chromephp.com
During my development career i have not stumbled upon a software that displays the output you describe in your question. It would be a wonderful program or feature i believe but sadly i have not found any.
Like Andrew and nickf have answered, there are some good tools out there and until someone sits down and writes this, it looks like we are out in the cold.
I was looking for similar solution which wasn't heavy and even better I didn't need to include any classes, so I created simple function that outputs php to browser console, you can check it here:
Outputting PHP To Browser Console