php 5.2 (with pdo + pdo_mysql) on centos 5.3

after installing/removing various php installs from various repos - the final solution for php5.2 on centos5.3 is:

yum install yum-priorities

create a centos5test .repo file

vi /etc/yum.repos.d/c5-testing.repo

and paste in

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing

then run

yum --enablerepo=c5-testing install php

yum --enablerepo=c5-testing install php-devel php-pear

sudo pecl install PDO_MYSQL

sudo yum --enablerepo=c5-testing install php-mysql

sudo /etc/init.d/httpd restart

running dropbox on centos in a headless/vps setup

wget -O dropbox.tar.gz http://www.getdropbox.com/download?plat=lnx.x86
tar zxof dropbox.tar.gz
wget http://dl.getdropbox.com/u/6995/dbmakefakelib.py
wget http://dl.getdropbox.com/u/6995/dbreadconfig.py
python dbmakefakelib.py

no gcc so install it

sudo yum install gcc
python dbmakefakelib.py

you should get the below meeages:

dropboxd ran for 15 seconds without quitting - success?

just control-c out of this and continue

python dbreadconfig.py

python errors - need to manully open sqlite

cd .dropbox
sqlite3 dropbox.db
sqlite> .dump config

paste the 'host_id' into http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/
paste the result ( the stuff after the 'V' ) at the end of this url ( https://www.getdropbox.com/cli_link?host_id= )and enter in your browser
you'll be asked to log into dropbox - this should link your account to your server

mkdir ~/Dropbox

To start drop box just run

~/.dropbox-dist/dropboxd &

If you want to run dropbox as a services

sudo vi /etc/init.d/dropbox

and paste in the below code
note: change "user1 user2" to the user(s) on the server running dropbox

# chkconfig: 345 85 15
# description: Startup script for dropbox daemon
#
# processname: dropboxd
# pidfile: /var/run/dropbox.pid
 #
# Source function library.
. /etc/rc.d/init.d/functions

DROPBOX_USERS="user1 user2"

prog=dropboxd
lockfile=${LOCKFILE-/var/lock/subsys/dropbox}
RETVAL=0

start() {
        echo -n $"Starting $prog"
         for dbuser in $DROPBOX_USERS; do
            daemon --user $dbuser /bin/sh -c "/home/$dbuser/.dropbox-dist/dropboxd&"
        done

        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
         return $RETVAL
}

stop() {
        echo -n $"Stopping $prog"
    for dbuser in $DROPBOX_USERS; do
        killproc /home/$dbuser/.dropbox-dist/dropboxd
    done
        RETVAL=$?
         echo
        [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
   restart)
        stop
        start
        ;;
  *)
        echo $"Usage: $prog {start|stop|restart}"
        RETVAL=3
esac

exit $RETVAL

sudo chmod +x /etc/init.d/dropbox
sudo /sbin/chkconfig --add dropbox
sudo chmod 755 /etc/init.d/dropbox

to start dropbox

/etc/init.d/dropbox start

Mysql logging on CentOS 5.3

for whatever reason when i edited my.cnf on CentSO 5.3 the logging options were never picked up no matter what i tried

gave up messing with my.cnf and put them directly in the init.d file and all was well

1 - make sure that the log files are available and writeable by the mysql user

2 - edit /etc/init.d/mysqld

find the mysqld_safe section and add the --log** sections in as below

        # but we need to be sure.
        /usr/bin/mysqld_safe   --datadir="$datadir" --socket="$socketfile" \
                --log-error="$errlogfile" --pid-file="$mypidfile" \
                --log=/var/log/mysql.log \
                --log-slow-queries \
                --slow_query_log_file=/var/log/mysql-slow.log \
                --federated \
                --user=mysql >/dev/null 2>&1 &
               
3 - sudo /etc/init.d/mysql restart

and your off logging as normal

note: the general log ( --log=/var/log/mysql.log \ ) will slow this down

mysql autostart on centos

just setup mysql on centos and forgot to set it to auto-start on boot - there the quick fix

sudo /sbin/chkconfig --level 2345 mysqld on
check that this worked as expected by running the chkconfig list

/sbin/chkconfig --list

should result in the below output

mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off

installing php5.3 with xml support on centos

just setup a new vps with centos and needed the latest php5.3 - heres the shortcuts

sudo rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
cd /etc/yum.repos.d/
sudo wget http://repo.webtatic.com/yum/webtatic.repo
sudo yum --enablerepo=webtatic update php

php-xml is not availble in the webtatic repo - you can manually download the rpm from fubra with wget

sudo wget http://mirror.fubra.com/php-5.3-repo/5/i386/php-xml-5.3.0-3.i386.rpm
sudo rpm -ivh php-xml-5.3.0-3.i386.rpm

restart apache, check you php.ini and away you go

---
refer: webtatic blog post for more info