Setting up Xdebug with Zend Server on Linux
Since our team work on different operating system, we switched for custom apache/php/mysql installs to Zend Server. Before everyone was using something different (the guys on windows were using XAMP, WAMP, on ubuntu i was using the packages in the repo and on the server we're using apache from cPanel) and applications were behaving a differently according to the default settings for all those platforms.
So we decided to install Zend Server CE as it has more or less the same settings over different platforms. I've had some bad experiences installing ZSCE on a system that already had apache installed via apt, but after a clear install of Karmic, ZF was running like a charm. The install process described in the online documentation works great.
After install is done, make sure to symlink php, pecl, pear and phpize so you can access them system wide:
sudo ln -s /usr/local/zend/bin/zendctl.sh /usr/sbin/zendctl sudo ln -s /usr/local/zend/bin/pear /usr/sbin/pear sudo ln -s /usr/local/zend/bin/pecl /usr/sbin/pecl sudo ln -s /usr/local/zend/bin/php /usr/sbin/php sudo ln -s /usr/local/zend/bin/phpize /usr/sbin/phpize
At this point you should be able to run php -i in terminal and the phpinfo will be displayed.
Next step is to install xdebug via pecl by running:
sudo pecl install xdebug
If all went well you should have the xdebug library located at /usr/local/zend/lib/php_extensions/xdebug.so . If you don't have it there, then something went wrong and you should NOT continue reading. This issue must be sorted first.
Next you need to comment out the 1st line of /usr/local/zend/etc/conf.d/debugger.ini so it looks like this:
#open editor gksu gedit /usr/local/zend/etc/conf.d/debugger.ini # this is how the 1st two lines should look afterwards ; register the extension to be loaded by Zend Extension Manager ;zend_extension_manager.dir.debugger=/usr/local/zend/lib/debugger
Xdebug needs to be loaded before Zend Extension Manager, that's why you need to add the following line just on top of the /usr/local/zend/etc/ext.d/extension_manager.ini
#open the editor gksu gedit /usr/local/zend/etc/ext.d/extension_manager.ini #add this line on 1st line: zend_extension=/usr/local/zend/lib/php_extensions/xdebug.so #save the file
Restart zend server by running:
sudo /etc/init.d/zend-server restart
You can check if xdebug is working like so:
php -i |grep xdebug
The output should be something similar to this:
xdebug xdebug support => enabled xdebug.auto_trace => Off => Off xdebug.collect_includes => On => On xdebug.collect_params => 0 => 0 xdebug.collect_return => Off => Off xdebug.collect_vars => Off => Off xdebug.default_enable => On => On xdebug.dump.COOKIE => no value => no value xdebug.dump.ENV => no value => no value xdebug.dump.FILES => no value => no value xdebug.dump.GET => no value => no value xdebug.dump.POST => no value => no value xdebug.dump.REQUEST => no value => no value xdebug.dump.SERVER => no value => no value xdebug.dump.SESSION => no value => no value xdebug.dump_globals => On => On xdebug.dump_once => On => On xdebug.dump_undefined => Off => Off xdebug.extended_info => On => On xdebug.idekey => mimir => no value xdebug.manual_url => http://www.php.net => http://www.php.net xdebug.max_nesting_level => 100 => 100 xdebug.profiler_aggregate => Off => Off xdebug.profiler_append => Off => Off xdebug.profiler_enable => Off => Off xdebug.profiler_enable_trigger => Off => Off xdebug.profiler_output_dir => /tmp => /tmp xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p xdebug.remote_autostart => Off => Off xdebug.remote_enable => Off => Off xdebug.remote_handler => dbgp => dbgp xdebug.remote_host => localhost => localhost xdebug.remote_log => no value => no value xdebug.remote_mode => req => req xdebug.remote_port => 9000 => 9000 xdebug.show_exception_trace => Off => Off xdebug.show_local_vars => Off => Off xdebug.show_mem_delta => Off => Off xdebug.trace_format => 0 => 0 xdebug.trace_options => 0 => 0 xdebug.trace_output_dir => /tmp => /tmp xdebug.trace_output_name => trace.%c => trace.%c xdebug.var_display_max_children => 128 => 128 xdebug.var_display_max_data => 512 => 512 xdebug.var_display_max_depth => 3 => 3
Note the xdebug support => enabled on line 2.
Hope that helps
Made the switch to wordpress
I've been using MovableType as the platform for my blog and i've been really happy with it. The reason i decided to switch to Wordpress is simply because it's written using PHP and i'm able to easily extend it, unlike MT which is built in perl.
I haven't got a change to import the comments so far, but hopefully i'll get to that this week.
Let me know if you find a broken link or something unusual.
So… ’sup?
- With your linux box i mean... What's up with it?
- Not much... here goes:
User: mimir (uid:1000) Groups: mimir adm dialout cdrom plugdev lpadmin admin sambashare vboxusers Working dir: /home/mimir Home dir: /home/mimir Hostname: orion IP (lo): 127.0.0.1/8 IP (eth1): 192.168.1.102/24 Gateway: 192.168.1.1 Name Server: 208.67.222.222 Name Server: 208.67.220.220 Date: Wed Jan 21 19:43:43 EET 2009 Uptime: 19:43:43 up 9:44, 3 users, load average: 0.56, 0.42, 0.25 Kernel: Linux orion 2.6.28-4-generic #11-Ubuntu SMP Fri Jan 16 21:50:52 UTC 2009 x86_64 GNU/Linux Memory: Total: 3895Mb Used: 3071Mb Free: 823Mb Swap: Total: 1953Mb Used: 7Mb Free: 1945Mb Architecture: Processor: 0 : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz Processor: 1 : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz
All that info is found just by invoking Scott Morris's 'sup script.
Cool script!
Chmod only files or chmod only folders
I moved the blog the a new server and i realised that all the permissions got screwed up on the process. All files and folders were having chmod 777, and that's not exactly ideal. After digging a bit on google on how to chmod only files or chmod only folders, i came up with this:
1. Recursive chmod only files within this folder:
find . -type f -exec chmod 0600 {} ;
2. Recursive chmod only folders within this folder:
find . -type d -exec chmod 0755 {} ;
Hope this helps!
Google Chrome for Linux and Mac with CrossOver Chromium
Two weeks ago i have posted a tutorial on how to make Google Chrome run on Linux using wine. That gave Linux users the option to test the browser without having to go to a Windows machine, but it was not perfect as it lacked HTTPS support.
CrossOver packaged for both Linux and Mac the browser and it supports HTTPS. Check it out at: http://www.codeweavers.com/services/ports/chromium/
Note that this package does NOT play flash files. In order to get flash pages to play you just have to go to http://www.adobe.com and install the flash player as if you were running windows.
Install Vuze on Ubuntu 64bit
I have just reinstalled Ubuntu 64bit and i wanted to download some torrent. I like the default torrent client that comes with Ubuntu, but i missed the features of Azureus so i decided to give Vuze a try. Unfortunately this did not went as smooth as i would have expected, and this is because Vuze (which is built on the Eclipse platform) comes with the 32bit version of swt.
Here is a tutorial on how to install vuze on ubuntu 64bit.
1. Prepare install folder
mkdir ~/Applications
2. Download and extract Vuze
cd
wget http://cache2.vuze.com/files/Vuze_linux.tar.bz2
tar jxvf Vuze_linux.tar.bz2
mv vuze ~/Applications
3. Download and extract the latest 64bit SWT (you can get the latest URL from theEclipse SWT Project Page)
wget http://eclipse.ialto.org/eclipse/downloads/drops/R-3.4-200806172000/swt-3.4-gtk-linux-x86_64.zip
mkdir swt
mv swt-3.4-gtk-linux-x86_64.zip swt
unzip swt-3.4-gtk-linux-x86_64.zip
mv swt.jar ~/Applications/vuze/
4. Enjoy Vuze by starting it from terminal:
~/Applications/vuze/vuze
Install Adobe Flash Player 10 on Ubuntu 64bit
UPDATE: Native Adobe 64bit Flash Player has been released.
I have put together a small tutorial on how to install the native flash player 10 64bit plugin for linux.
Adobe recently launched Flash Player 10 Beta codenamed "Astro". Great news, as it supports a bunch of new features, but as usually nothing yet for the 64 bit users. I'm going to show you how to get flash player 10 running on Ubuntu 64bit using nspluginwrapper. Before doing anything in the terminal make sure you close Firefox else you might not get the expected result.
1. Make sure you don't have any other flash plugin installed on your system:
sudo apt-get remove -y --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper
1.1 To be sure we don't have any other old flash libs let's cleanup the folders where it usually resides:
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper
2. Install ia32-libs and latest nspluginwrapper
sudo apt-get install ia32-libs nspluginwrapper
3. Download the latest flash player from Adobe Labs and extract it:
cd ~
wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_install_linux_051508.tar.gz
tar zxvf flashplayer10_install_linux_051508.tar.gz
sudo cp install_flash_player_10_linux/libflashplayer.so /usr/lib/mozilla/plugins/
rm -rf ~/install_flash_player_10_linux/
4. Use nspluginwrapper to install the plugin and link it to firefox
sudo nspluginwrapper -i /usr/lib/mozilla/plugins/libflashplayer.so
sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/mozilla/plugins/
sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/firefox-addons/plugins/
EDIT: here is how to install flash player 10 on 64bit systems for Liferea and Vuze
sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/xulrunner-addons/plugins/
5. Start Firefox and type in the address bar about:plugins and press enter. You should get a result similar to this one:
6. Go to http://labs.adobe.com/technologies/flashplayer10/demos/index.html and test the new features.
EDIT: if you are lazy by nature, you can just grab install_flash_player_10_ubuntu64bit, a small script i put together. Make it executable (chmox +x install_flash_player_10_ubuntu64bit) and run it in terminal. It will kill ask you for root password the kill any Firefox you might have running and install the flash player 10
NOTE: for the new and improved script follow this URL: http://meandubuntu.wordpress.com/2008/08/20/flash-10-rc-on-ubuntu-amd64/