Category Archives: PHP
We have switched from Apache to Nginx a month ago. PHP is running on FastCGI using PHP-FPM. I have just recently tried to debug our app using FirePHP and got a 502 Bad Gateway response from Nginx. It looks like Nginx by default limits the header output. This is the error in Nginx’s error log: [...]
This is a quick fix for PHP errors like these on a Media Temple DV: Warning: include_once() [function.include-once]: open_basedir restriction in effect. I got this a few days ago when trying to setup an app. There are instructions in Media Temple’s site on how to fix this but this set of steps is what worked [...]
This article assumes that you are familiar with the Facebook SDK Core Concepts and know how to request a user’s access token. This also uses the Facebook PHP SDK. Getting the list of friends You can get the friends of a Facebook user using this FQL query: SELECT uid FROM user WHERE uid IN (SELECT [...]
This was tested on CentOS 5.6 on a fresh MediaTemple (dv) setup. I figure it should be the same for any CentOS install. This set of instructions is a result of hours spent on installation troubleshooting; google searches; and trial and errors. Hopefully this can help other people. Install dependencies These are needed to enable [...]
To integrate libraries using namespaces into a Yii Framework project, you can simply use Yii::setPathOfAlias to have the classes autoloaded by Yii when needed. Just specify the root namespace as the alias and the physical location of that root alias as the path. Using Predis as an example, if we put the code in: /vendors/predis/lib/Predis [...]
Update Jan 13, 2012: It looks like setting a custom image service is no longer available on Twitter for iPhone. Tweetbot allows it though. This article still works for Tweetbot. For the rest of this article, please treat the text “Twitter for iPhone” as any app that supports custom image services (e.g. Tweetbot). We’ve just [...]
Stupid stupid me. On Windows/WampServer, I’ve always had this problem when working with PHP code that can run in the console and using cURL methods.. PHP Fatal error: Call to undefined function curl_init() in D:\Shiki\github\yii-clockwerk\test-app\CurlHelper.php on line 90 Fatal error: Call to undefined function curl_init() in D:\Shiki\github\yii-clockwerk\test-app\CurlHelper.php on line 90 It (cURL) works in the [...]
I made this a few weeks ago. It is a Yii Framework extension which routes log messages to FirePHP. Requirements Download the extension from the Yii Framework extension page or GitHub. Install Firebug and FirePHP plugins for Firefox. Enable output_buffering in php.ini. Installation Download and extract the “shiki” folder to your extensions directory. This is [...]
Updated: December 28, 2010 First off, all credits go to this guy. I’m just listing the steps on how I did it in Windows 7 with PHP 5.3. Also, I tested this using WampServer but I believe it should work on any PHP install. Install memcached Download the Memcached Win32 library here: http://code.jellycan.com/memcached. Just get [...]
As the title says, I’m currently having fun learning and using Joomla! and WordPress. For the uninformed, Joomla! is a website content management system and WordPress is a weblog content management system. Both are quite similar but built for different purposes. Joomla! is more suitable for business and organization websites, large websites in particular. It [...]