PHP debugging with remote shell access

I play with a PHP weblog application using a shared hosting service as part of the PHP learning process. The service provider has a typical LAMP environment with ssh remote access.

Vim was my best friend in learning PHP code. However, sometimes it was difficult for me to track the data in the code in case of an error. For example, sometimes I visit a page and I get a blank response without any error messages. How should I debug this? Any tools that will be helpful?

My experience was mainly in C / C ++, Perl and some CGI programs. So PHP is a very refreshing experience :-)

In case that matters, the application I'm playing with is Lyceum , and I don't have much choice on LAMP.

EDIT: free software tools :-)

+3
source share
5 answers

I assume that your hosting provider has configured the PHP installation using display_errors , which is very good. That is why you see blank pages. Therefore, the most practical solution at the moment would be to have a .htaccess file that includes it:

php_flag display_errors on

You will also need error_reporting for the corresponding value:

php_flag error_reporting "E_ALL | E_STRICT"

In any case, be sure to disable this before allowing users access to your website.

Xdebug, Eclipse PDT IDE NetBeans PHP . , , Xdebug . , , .

+4

( XAMPP, ) XDebug.

PhpEd , Eclipse PDT.

php ini , . , FirePHP, .

+2

jEdit vim. SFTP (, ) PHP , PHPParser .

, , , . , , config, :

// Report all PHP errors
error_reporting(E_ALL);

- , .

+1

, , , - , display_errors. PHP Apache error-log, .

Xdebug. , . , vim .

+1

NuSphere PhpED

0

Source: https://habr.com/ru/post/1702568/


All Articles