Install Xdebug php debugger on WebFaction

This post will detail how to install Xdebug on a WebFaction hosting account:

http://docs.webfaction.com/software/php.html contains useful information but may be inaccurate depending on which version of PHP your application is configured to use.

1. Unpack the tarball: tar -xzf xdebug-2.x.x.tgz.

2. cd xdebug-2.x.x

3. Run phpize – the command for this will depend on which PHP version your application uses. For example, in your Domains/Websites > Applications, if your web app is using PHP 5.4 your phpize command will be phpize54 located in /usr/local/bin

4. ./configure –enable-xdebug –with-php-config=/usr/local/bin/php54-config

5. Run: make

6. cp modules/xdebug.so /home/<username>/modules

7. add the following line to your web application php.ini (/home/<username>/webapps/<webappname>/php.ini:
zend_extension=”/home/<username>/modules/xdebug.so”

8. Verify installation by creating a phpinfo.php page containing “<? phpinfo(); ?>”. Load…

More



Python development on Windows – Setuptools & Pip configuration

Sometimes installing Python modules on Windows is a pain. You have seen the setuptools error message complaining that you don’t have Visual Studio 2003 installed? Yes, well then you have probably seen that the fix is easy:

python setup.py build –compiler=mingw32 install

But what if you want to install using easy_install or pip? or you want to use a pip requirements.txt file in a virtualenv? I have the solution for you.

First: Install MinGw including gcc, make and all the other regular goodies you would have on a Unix system.

Second: Add your \MinGw\bin directory to your path.

Third: If you are using an older version of Python (pre 2.6.6) you will have to manually set your HOME environment variable to your user directory…

More



Nginx Spawn-fcgi script for Debian

Looking for a script to manage fcgi for you? Props go to SaturnBoy for his script found at http://saturnboy.com/2008/10/nginx-init-script/

#!/bin/bash
BIND=127.0.0.1:9000
USER=www-data
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/spawn-fcgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS=”- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND”
RETVAL=0
start() {
echo -n “Starting PHP FastCGI: ”
start-stop-daemon –quiet –start –background –chuid “$USER” –exec /usr/bin/env — $PHP_CGI_ARGS
RETVAL=$?
echo “$PHP_CGI_NAME.”
}
stop() {
echo -n “Stopping PHP FastCGI: ”
killall -q -w -u $USER $PHP_CGI
RETVAL=$?
echo “$PHP_CGI_NAME.”
}
case “$1” in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo “Usage: php-fastcgi {start|stop|restart}”
exit 1
;;
esac
exit $RETVAL

Nginx.conf from

http://elasticdog.com/2008/02/howto-install-wordpress-on-nginx/

More