Category Archives: PHP

Ehm. PHP?

APC cache and Symfony projects in Fedora 25/26

To be able to run Symfony project on Fedora 25/26 server with Apache (httpd) you need to install the “APCu Backwards Compatibility Module” $ dnf install php-pecl-apcu-bc Otherwise you will be getting the following error: PHP Fatal error: Call to undefined function Doctrine\Common\Cache\apc_fetch() in /home/maf/symfony/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php on line 40

Require specific commit and branch from GitHub with Composer

If you need to include specific branch and/or specific commit from GitHub into your project via Composer use following syntax: { “minimum-stability”: “dev”, “require”: { “vendor/package”: “dev-branchname#6bdd====full commit id====a9c6”, } , “repositories”: [ { “type”: “git”, “url”: “https://github.com/user/repo.git” } ] } branch name gets always dev- in front (so branch “features” translates to “dev-features”) you […]

PHP var_dump() to error log

Nice function to var_dump() any variable into php error_log()… Sometimes it can be very usefull for debugging purposes. function var_error_log( $object=null ){ ob_start(); // start buffer capture var_dump( $object ); // dump the values $contents = ob_get_contents(); // put the buffer into a variable ob_end_clean(); // end capture error_log( $contents ); // log contents of […]