Tag Archives: php

Install WordPress on CentOS/RHEL in Five Minutes Flat (remix)

Install the System Prerequisites # yum install mysql-server httpd nano php php-mysql # chkconfig httpd on # chkconfig mysqld on # service mysqld start # service httpd start Create the Database # mysqladmin create wordpress # mysql mysql> GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpress’@'localhost’ IDENTIFIED BY ‘please+use+a+strong+password’; mysql> FLUSH PRIVILEGES; mysql> quit Download and [...]

Posted in essays | Also tagged , , , | 1 Comment

HipHop for PHP on OS X

Link: HipHop for PHP on OS X The OS X fork of Facebook’s HipHop project: HipHop is a source code transformer which transforms PHP source code into highly optimized C++ and then compiles it using g++.

Posted in links | Also tagged , | Leave a comment

MVC Web Frameworks: PHP vs. JVM

I am reviewing web frameworks for product development at Resource Interactive. Here are my thoughts. Please keep this in mind when reading the following: ALL of the statements below are OPINIONS. Please feel free to disagree. Problem We’ve been using CakePHP for 6 months, but recently it has been getting in our way on a [...]

Posted in essays | Also tagged , , , , , , , , , | Leave a comment

Debugging PHP + cURL Using Charles Proxy

To debug/inspect cURL requests and responses in PHP, proxy the requests through an HTTP proxy like Charles: curl_setopt($ch, CURLOPT_PROXY, “127.0.0.1″); curl_setopt($ch, CURLOPT_PROXYPORT, 8888); To avoid certificate trust errors, disable SSL certificate verification in your development environment (do not disable in production environments!): curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); via Charles Documentation.

Posted in essays | Also tagged , | Leave a comment

PHP 5.3 for Mac OS X 10.5 (Leopard)

Link: PHP 5.3 for Mac OS X 10.5 (Leopard) Thank you Marc Liyanage!

Posted in links | Also tagged | Leave a comment

HipHop for PHP

Link: HipHop for PHP Facebook’s PHP to C++ source code transformer released with open source license! HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features — such as eval() — [...]

Posted in links | Also tagged | Leave a comment

CakePHP Migrations on Mac OS X 10.6 Snow Leopard

Enable PHP, install PEAR, update system PATH, and update PHP include_path Open Terminal and install MDB2: cd /usr/local sudo pear install MDB2-2.5.0b2 sudo pear install MDB2_Driver_mysql-1.5.0b2 And then… Install CakePHP DB Migrations If MDB2 throws a “Native Code: 2002″ error when you “cake migrate” or “cake populate”, PHP is probably looking for mysql.sock in a [...]

Posted in essays | Also tagged , | Leave a comment

CakePHP Command-Line Console in Mac OS X Snow Leopard

The instructions below should work for all versions of Mac OS X. YMMV. You may substitute .profile for .bash_profile. Older versions of Mac OS X may need to substitute “nano” for “pico”. nano ~/.bash_profile Add or edit the PATH line to get “cake bake …” working within your app/ directory: PATH=”$PATH:../cake/console/” If you want “cake [...]

Posted in essays | Also tagged , , | Leave a comment

CakePHP + mod_rewrite on Snow Leopard

Creating a CakePHP 1.2.5 app on a Snow Leopard machine, which comes with PHP 5.3, I encountered the following error when I tried to run the app: “The requested URL /Users/username/Sites/cakeapp/app/webroot/ was not found on this server.” The solution is to use the RewriteBase directive in ~/Sites/cakeapp/.htaccess: <IfModule mod_rewrite.c> RewriteEngine On # NOTE THE TILDE: [...]

Posted in essays | Also tagged , , , | Leave a comment

Akelos vs. Cake: Let me eat Cake.

I’m still drinking the Ruby Kool Aid, but when I have to PHP in my own well: class User extends AppModel { var $name = ‘User’; var $primaryKey = ‘user_id’; var $useDbConfig = ‘alternate’; } — Cake: easy as pie. class User extends ActiveRecord { function init ($attributes = array()) { parent::init($attributes); $this->setPrimaryKey(‘user_id’); } function [...]

Posted in essays | Also tagged , | Leave a comment