Optimizing PHP for Scripts

November 12, 2014

I use PHP most of the time while creating workflows for Alfred. But, the philosophy of PHP is to run in memory on the server as fast as possible. Therefore, it loads every library it thinks it will use each time it is loaded. This makes for slow scripts!

To get around that, open up your php.ini file for your PHP interpreter and comment out any library that you will not use on the command line. Now when you load a PHP script, it will not do all that extra work!


comments powered by Disqus