7/10/2013

yum install xdebug + xdebug test example for php 5.4

Xdebug  is a nice tool for PHP development. The following is taken from official site:

Xdebug's basic functions include the display of stack traces on error conditions, maximum nesting level protection and time tracking.

There are many ways to install xdebug. Now I give one way to use yum for xdebug installment.

 sudo yum  install php-xdebug

or with enable remi repo

sudo yum --enablerepo=remi install php-xdebug

------------------------------------------------------example---------------------------------------------------------------
now let us test one example for xdebug

vi test.php


<?php 

echo $a;

$a++;

echo $a;
?>


>> php test.php

PHP Notice:  Undefined variable: a in /var/www/a.php on line 3
PHP Stack trace:
PHP   1. {main}() /var/www/a.php:0
PHP Notice:  Undefined variable: a in /var/www/a.php on line 5
PHP Stack trace:
PHP   1. {main}() /var/www/a.php:0

7/05/2013

PHP5.4+MySQL5.5+HTTPD+CentOS6.4

0. Download and install VirtualBox 4.2.6
   https://www.virtualbox.org/wiki/Downloads

1. Download CentOS 6.4
   http://ftp.jaist.ac.jp/pub/Linux/CentOS/

2. Install + configure Network

3. Update yum
  yum update
  yum install gcc kernel-devel kernel-headers

 Restart your centos system

4. Install Virtual LinuxAddtions
    If you meet error with[Building the OpenGL support module  [FAILED]] , please use the following command
export MAKE='/usr/bin/gmake -i'

./VBoxLinuxAdditions.run


if you still have errors, please try

/etc/init.d/vboxadd setup

5. Start your httpd 
   service httpd start
    #auto start 
   chkconfig httpd on  

6.   install repos for php-5.4 
   rpm -Uvh http://rpms.famillecollet.com/enterprise/6.4/remi/x86_64/remi-release-6-2.el6.remi.noarch.rpm
    rpm -Uvh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
   
   #check yum repo for remi.repo epel.repo
  ls /etc/yum.repos.d/

7.  install php 5.4
   yum --enablerepo=remi install php php-string

8. Install mysql 5.5
  yum --enablerepo=remi install mysql mysql-server
  #auto start when PC start
 chkconfig mysqld on