PHP.ini Timezone

Posted on Thursday, May 27, 2010 in PHP

EST Example:
date.timezone = "America/New_York"

Ubuntu Server Install PHP 5.3

Posted on Friday, May 21, 2010 in Linux

This is example works on Ubuntu Server 9.04 and PHP 5.3.2
First remove all instances of PHP and related packages

1. add to /etc/apt/sources.list:
deb http://php53.dotdeb.org stable all
deb-src http://php53.dotdeb.org stable all

2. update and upgrade:
#apt-get update && apt-get upgrade

3. install:
#apt-get install php5 libapache2-mod-php5 php5-cli php5-mysql

4. check PHP version:
#php -v

Restart Apache

Ubuntu Package Search

Posted on Thursday, May 20, 2010 in Linux

apt-cache search [package]

Installing APC and eAccelerator for PHP

Posted on Thursday, May 20, 2010 in Linux, PHP

Examples done on Ubuntu 9.04

Installing and Configuring APC:

#apt-get update
#apt-get install php5-dev
#apt-get install php-pear
#apt-get install apache2-threaded-dev
#apt-get install make
#pecl install APC

Add to php.ini:
extension=apc.so
may need to disable zend optimizer (or install as zend optimizer extension)
;zend_extension=/dir/ZendOptimizer.so
Usage:
apc_store("my_key",$obj,3600);
$cached_obj=apc_fetch("my_key");

Installing and Configuring eAccelerator
#cd /tmp/
#wget http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2
#tar xvjf eaccelerator-0.9.5.3.tar.bz2
#cd eaccelerator-0.9.5.3
#phpize
#./configure --with-eaccelerator-shared-memory
#make
#make install
#mkdir /var/cache/eaccelerator
#chmod 777 /var/cache/eaccelerator

add to php.ini:

;eAccelerator configuration
extension="eaccelerator.so"
eaccelerator.shm_size = "16"
eaccelerator.cache_dir = "/var/cache/eaccelerator"
eaccelerator.enable = "1"
eaccelerator.optimizer = "1"
eaccelerator.check_mtime = "1"
eaccelerator.debug = "0"
eaccelerator.filter = ""
eaccelerator.shm_max = "0"
eaccelerator.shm_ttl = "0"
eaccelerator.shm_prune_period = "0"
eaccelerator.shm_only = "0"
eaccelerator.compress = "1"
eaccelerator.compress_level = "9"

Usage:
eaccelerator_put("my_key",serialize($obj),3600);
$cached_obj=unserialize(eaccelerator_get("my_key"));

Restart apache2

Ubuntu Version Command Line

Posted on Thursday, May 20, 2010 in Linux

#cat /etc/issue

RAR Project Archive Example

Posted on Wednesday, May 19, 2010 in MS OS

Example removes “.svn” directories from archive:
ECHO OFF
SET release=%date:~12,2%.%date:~4,2%.%date:~7,2%.%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
SET release=%release: =%
SET winrar="\program files\WinRAR\WinRAR.exe" a -ep1 -e -r -t -x*\.svn*
SET box=M:\

CLS
:MENU
ECHO.
ECHO Archive Project
ECHO -----------------------
ECHO.
ECHO 1 - Example Project
ECHO Q - Exit
ECHO.
SET /P M=Type option then press ENTER:
IF %M%==1 GOTO EXAMPLE
IF %M%==Q GOTO:EOF
IF %M%==q GOTO:EOF

:_EOF
pause
GOTO:EOF

:EXAMPLE
SET ver=1.0.0
ECHO Archiving release
%winrar% "%box%example_project.%ver%.%release%.rar" x:\example_project\*.*
ECHO Done archiving release: example_project.%ver%.%release%.rar
ECHO.
GOTO _EOF

Change Subversion Repository UUID

Posted on Wednesday, May 19, 2010 in Linux

Check svn repository uuid:
#svnlook uuid /home/example/project
Example output:
ec932a82-3007-40d5-ad6d-96453a70e36d
Changed svn uuid:
#svnadmin setuuid /home/example/project a17cfs5a-10z3-4c51-a3a6-4d48f69865ca
Check modified uuid:
#svnlook uuid /home/example/project
a17cfs5a-10z3-4c51-a3a6-4d48f69865ca

Remove .svn Directories from Project (recursive)

Posted on Wednesday, May 19, 2010 in Linux

Navigate to project directory and execute:
#find ./ -name ".svn" | xargs rm –Rf

NetBeans PHP Installer Hangs Fix

Posted on Tuesday, May 18, 2010 in MS OS

For NetBeans 6.8 PHP Windows Installer
If installer hangs, run from the console
netbeans-6.8-ml-windows.exe --extract
and then
java -jar bundle.jar > log.txt 2>&1

Found here