Sunday, December 05, 2010

PHP5.3 on Ubuntu Lucid Lynx 10.4

I found myself needing to install PHP5.3 on a new install of Ubuntu Lucid Lynx 10.4 recently, here's how I did it:

followed:
http://www.robsearles.com/2010/03/17/installing-php5-3-on-ubuntu-karmic/

Had to get libicu38
https://launchpad.net/ubuntu/hardy/amd64/libicu38/3.8-5

Had to remove the newer version of libkrb - which removed apache and everything (couldn't ssh in after this - so need to then
apt-get install openssh-server

wget http://us.archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb53_1.6.dfsg.4~beta1-5ubuntu2_amd64.deb

aptitude install libicu38 apache2 apache2-mpm-prefork mysql-client-5.1 mysql-server-5.1 php5 php5-cli php5-mysql libapache2-mod-php5

set timezone in /etc/php5/apache2/php.ini :
date.timezone = Europe/London

I also wanted mod_rewrite:
sudo a2enmod rewrite

aptitude install curl curl-ssl php5-curl

/etc/init.d/apache2 restart

Hope this helps someone.

Saturday, October 09, 2010

XDebug using a Parallels VM and PHPStorm 1.0.2

I wanted to get XDebug working with my new IDE of choice: PHPStorm. I'm running a Parallels Virtual Machine (VM) with Ubuntu on it, and sharing my local folder on my Mac running Leopard.

I already had PHP 5.3.2, Apache 2.0 and mySQL running on the VM.

I installed XDebug using:
apt-get install php5-xdebug

This added a file named: "/usr/lib/php5/20090626+lfs/xdebug.so"

I then went in to /etc/php5/apache2/php.ini and added the following lines to the bottom:

zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=10.211.55.2
xdebug.profiler_enable=1
xdebug.profiler_output_dir=/tmp
xdebug.remote_log="/tmp/xdebug.txt"

----EDIT:----

Another time, I used this:

zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=33.33.33.1
xdebug.profiler_enable=1
xdebug.default_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=0

---------------

I also checked there was no zend lines referring to zend debuggers etc, which conflict.

The IP I used above was not the IP of the VM as reported when using ifconfig on the VM, it was instead the IP of my host machine (my mac):

ifconfig on my mac:


















I added a file phpinfo.php with to see the xdebug settings:



I now needed to set up PHPStorm to use this configuration:

Under: Run > Edit Configurations in PHPStorm:



Clicking on Server path mappings:



Above, I made sure to use the mount point that the VM was using - this was configured using Parallels > Virtual Machine > Configure > Shared Folders options tab previously when setting up my VM.

I had mapped the /media/psf/ mapping to /var/www/ using a symlink. ( ln -s)

Here is the server configuration



and the mappings tab:



I made sure my VM Apache was restarted:
/etc/init.d/apache2 restart

Now to debug, I could click the Run > Debug option in PHPStorm.

I hope this helps someone. Any questions, please email nathan [ at ] eit dot co dot nz.





Monday, June 14, 2010

GIT with CruiseControl

To get GIT to work as a plugin within cruisecontrol, you need to configure like this:

<plugin name="git" classname="net.sourceforge.cruisecontrol.sourcecontrols.Git" />

This is not obvious when looking here:
http://jpablobr.com/php-staging-environment-for-continuous-integration-part-2/

The resulting config.xml file will look like this:


<cruisecontrol>
<project name="socialgo" buildafterfailed="true">

<listeners>
<currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
</listeners>

<modificationset quietperiod="60">
<git localWorkingCopy="projects/${project.name}/source/"/>
</modificationset>

<plugin name="git" classname="net.sourceforge.cruisecontrol.sourcecontrols.Git" />

<bootstrappers>
<antbootstrapper anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml" target="build" />
</bootstrappers>

<schedule interval="300">
<ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/>
</schedule>

<log>
<merge dir="projects/${project.name}/target/test-results"/>
</log>

<publishers>
<onsuccess>
<artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/target/${project.name}.jar"/>
</onsuccess>
</publishers>

</project>
</cruisecontrol>










Wednesday, March 24, 2010

Calum's website

Calum Ryan ( @zizzfusion ) is offering a free pizza voucher prize - and although I love pizza, I'm always interested in commenting or helping on any website designs that people ask for feedback about.

The website is: http://www.zizzfusion.com/

The things that I like:
- that smokey look at the top
- easy to see fresh articles from the homepage - with comment count as bubbles.
- simple top right navigation
- a contact form on the homepage
- flickr photos
- screen shot popup - love these things.

The things I would change (if I had time - and yeah, I never do have time so I understand):
- the positioning of the popup about this competition - overlays the logo - could do with a cookie check to see it doesn't show again when refresh the homepage, but ideally slide it in, and position it so it doesn't look like an overlay banner advert.
- when viewing on 1024*768 there is no margin and slightly to wide, so the nice circle to the right is cut off and a unnecessary scroll bar appears.
- the logo is a bit flat - could do with some backdrops and colour contrast
- the logo does not appear on all pages - so I could be mistaken for looking at another website when going to the portfolio page
- portfolio page calls "articles" "tutorials"
- navigation doesn't show which page you are currently on
- Article category buttons only work for text area - expect the whole button to be clickable
- screen shot popup needs a close button at the top.
- could enhance the portrait picture on the portfolio page as it's very dark.
- description in meta tags could be stuffed with more keywords like "design, webdesign, london etc.. - not exceeding 156 characters of course.


With a few tweaks this could be a great website!