A quick way to check a .php file for syntax errors is to use the -l option of php.exe.
php -l /path/to/php/file.php
A quick way to check a .php file for syntax errors is to use the -l option of php.exe.
php -l /path/to/php/file.php
XDebug helps you debug or profile your php code. It is useful for complex sites where it is not feasible to read each line of source to determine where you should start optimizing (especially if those are not your own code, as in the case of contributed extensions). One point to note is that XDebug does not output in a human readable way, you need to use tools like kcachegrind to parse the output to gather information from it.
To install with pecl:
pecl install xdebug
You can craft your own .ini, or you can get a default (albeit unsupported) xdebug.ini from http://gggeek.altervista.org/2007/11/26/the-completely-unofficial-xdebugini/ and place it in /etc/php.d along with the ini’s of other modules.
Important directives:
zend_extension="/usr/lib/php5/20060613/xdebug.so" <– to enable this module, but set the path to your own path to xdebug.so. (use find -name xdebug.so to locate it)
xdebug.profiler_enable=1 to enable the profiller
xdebug.profiler_output_dir is the output directory for the logs. You can leave it as the default /tmp directory
restart apache
My colleage faced little problem today while transfering files to a server. The number of files were in the range of thousands, and we all know what a pain it is to ftp a large number of these small files ( Size wasn’t much of an issue compared to the overhead of commands).
Continue reading ‘Unzipping files using PHP’