Category Archives: PHP

PHP Errors to File

To log all PHP Errors to log file, edit php.ini file, add error_log = /var/log/php-errors.log To turn off displaying errors to browser, change value of display_errors to Off display_errors = Off

Posted in PHP | Tagged , | Leave a comment

Develop Java Project in ZendStudio

I recently started doing some small java projects. I have installed Eclipse/intelliJ. I prefer Eclipse as it compile program on saving. Since my project contains many independent programs i like this feature. I am already using ZendStudio 8. This is … Continue reading

Posted in PHP | Tagged , , , , | 1 Comment

Hide X-Powered-By: PHP

On a web site, HTTP headers show PHP version like X-Powered-By: PHP/5.1.6 [root@server12 ~]# curl -I http://netfree.netfreehost.com HTTP/1.1 200 OK Server: nginx/1.1.0 Date: Sun, 11 Sep 2011 20:00:40 GMT Content-Type: text/html Connection: keep-alive X-Powered-By: PHP/5.1.6 Cache-Control: no-cache, pre-check=0, post-check=0 Expires: … Continue reading

Posted in PHP | Tagged , , , | Leave a comment

Installing ioncube loader on CentOS

Download latest Ioncube loader for your OS from http://www.ioncube.com/loaders.php For CentOS 64 bit cd /usr/local/src wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz tar zxvf ioncube_loaders_lin_x86-64.tar.gz cd ioncube mkdir /usr/local/ioncube cp ioncube_loader_lin_5.2.so /usr/local/ioncube I coped ioncube_loader_lin_5.2.so as PHP version installed on the server was PHP 5.2 … Continue reading

Posted in PHP | Tagged , , , , | Leave a comment

PHP function to find file extension

To find file extension with PHP, use pathinfo function [code lang="php"] <?php $video = 'hostonnet.avi'; $info = pathinfo($video); echo '<pre>'; print_r($info); // File extension echo $info['extension'] . "<br>"; // avi // File Name with out extension echo $info['filename'] . "<br>"; … Continue reading

Posted in PHP | Tagged , , , | Leave a comment

Symfony 2 Migration to Git

Symfony is a PHP RAD framework like Zend Framework, CakePHP, etc… They have been using subversion for version control. Today while checking language section of github.com, i found Symfony version 2 is using git for source control. See the announcement … Continue reading

Posted in Git, symfony | Tagged , , | Leave a comment

PHP Tutorial Day 1

To run PHP programs you need a web server installed on your computer. For windows, it is better install Zend Server Community edition. Once you installed, you can start creating php programs. You need to upload Programs to DocumentRoot of … Continue reading

Posted in PHP Tutorial | Leave a comment

Can’t connect to local MySQL server through socket

While running symfony jobeet tutorial, i got following error fwh@pc11-desktop:~/web/jobeet$ php symfony doctrine:build-sql >> doctrine generating sql for models While exporting model class ‘JobeetAffiliate’ to SQL: PDO Connection Error: SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ … Continue reading

Posted in symfony | Tagged , | 1 Comment

Zend Framework error MySQL server through socket /tmp/mysql.sock

On a new apache/mysql installation, i got following error when connecting to mysql database in zend framework. An error occurred Application error Exception information: Message: SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) This is because … Continue reading

Posted in zend framework | Tagged , | Leave a comment

registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0

On a new Zend Framework project created with Zend Studio, accessing the public folder, git following error Notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in /usr/local/zend/share/ZendFramework/library/Zend/Loader.php on line 207 This was … Continue reading

Posted in PHP | Tagged , , | 2 Comments