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
Remove .svn folders recursively
I know that you have to use svn export in order to get a copy of the repo without the .svn folders inside, but sometimes you have to work with what you have, a checkout of a repo with .svn folders. And you want them removed.
After googling a bit i found a great way to recursively remove .svn folders. Just type the following while in the root of your checkout:
rm -rf `find . -type d -name .svn`
This tip was found on http://www.anyexample.com/linux_bsd/bash/recursively_delete__svn_directories.xml
Enable ls color support
By default i like to use the Green on Black color scheme with my terminals. When i enable the theme though, ls loses somehow the ability to show files in colors. The trick to enable the feature is simple. One just has to run ls like this:
ls --color=auto
Unfortunately this won't stick, and it'a a bit of a drag to always add the --color=auto part. To solve this, one has to create an alias to ls to point to ls --color=auto. You can do this by adding the following to ~/.bashrc
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
fi
Tada!
Ailurus project
I've been contacted a few days ago by Homer Xing from Ailurus project.
He's notified me about the addition of the script to install native flash player 64bit on ubuntu in the Ailurus project. I was thrilled. Since then Homer even built a version of the script to work on Fedora (which is now on this site also available) and we got in touch over IM.
I think Ailurus is an amazing project. Hardcore Linux users might not see why it's important to have projects like these, but someone new to linux will appreciate it. I can't stress enough how hard the Linux world seems to old windows users. It's not a matter of Linux being hard to learn, but more of windows being hard to forget. With tools like Ailurus that make installing applications a snap, i think the transition is made much easier.
Looking forward for future releases!
SVN Ignore all files inside a folder
If you want to ignore certain file types inside a folder on SVN it's pretty easy:
svn propset svn:ignore "*.tgz" backup
It's a bit more complicated if you want to ignore everything inside a folder (be it files or folders). If you have a structure as the following:
/public/media /public/media/member /public/media/member/artist /public/media/member/fan /public/media/member/label
and you want to ignore everything inside public/media, just do:
svn propset svn:ignore "*" public/media/
Video working with Logitech QuickCam Communicate STX on Linux 64bit
I have a 046d:08d7 Logitech, Inc. QuickCam Communicate STX that works perfectly well with all the native linux applications (ekiga, cheese, empathy) and even with the Flash Player powered TokBox, but it does not work with Skype.
After a bit of digging I've found out how to make Skype detect the video input from my Webcam. The secret is to preload the v4l1compat.so library as shown on the Ubuntu Wiki:
bash -c 'LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype'
That does the trick for 32bit systems, and since there isn't a native Skype version for 64bit
mimir@orion:~$ file /usr/bin/skype /usr/bin/skype: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped
we need to tell skype to preload the 32bit version of the library like so:
bash -c 'LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype'
Now video works perfectly using Skype 2.1.0.47 under Ubuntu 9.10 64bit
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!
Install native 64bit Flash Player 10 on Linux
EDIT: updated the scripts to install the 64-bit Flash Player 10 alpha refresh for Linux that was released on December 8th, 2009.
Adobe FINALLY released a native 64bit Flash Player 10 plugin. Although this is still an alpha release, the news is very exciting for Linux users, since we don't longer depend on nspluginwrapper, which although does the job, has it's drawbacks.
I have put together a small tutorial on how to install the native flash player 10 64bit plugin for linux.
#!/bin/bash # Script created by # Romeo-Adrian Cioaba romeo.cioaba@spotonearth.com echo "Stopping any Firefox that might be running" sudo killall -9 firefox echo "Removing any other flash plugin previously installed:" sudo apt-get remove -y --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper sudo rm -f /usr/lib/mozilla/plugins/*flash* sudo rm -f ~/.mozilla/plugins/*flash* sudo rm -f /usr/lib/firefox/plugins/*flash* sudo rm -f /usr/lib/firefox-addons/plugins/*flash* sudo rm -rfd /usr/lib/nspluginwrapper echo "Installing Flash Player 10" cd ~ wget http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.45.2.linux-x86_64.so.tar.gz tar zxvf libflashplayer-10.0.45.2.linux-x86_64.so.tar.gz sudo cp libflashplayer.so /usr/lib/mozilla/plugins/ echo "Linking the libraries so Firefox and apps depending on XULRunner (vuze, liferea, rsswol) can find it." sudo ln -sf /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/firefox-addons/plugins/ sudo ln -sf /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/xulrunner-addons/plugins/ # now doing some cleaning up: sudo rm -rf libflashplayer.so sudo rm -rf libflashplayer-10.0.45.2.linux-x86_64.so.tar.gz
You can now restart firefox
Some users seem to have problems with viewing this page, so i wrapped everything needed to install the native 64bit flash player on linux into a shell script. Grab the Ubuntu script here, chmod +x and execute it.
Thanks to Claudio de Taunay for providing a script that works in OpenSuSE 11. You can pick it up here.
Thanks to Homer Xing from the Ailurus project you can now install native flash player 64bit on Fedora. You can pick up the script here.
Let me know if you encounter any bugs.
the scripts to install in different distro:
Ubuntu: install native flash 64bit on Ubuntu
Fedora: install native flash 64bit on Fedora
OpenSuse: install native flash 64bit on OpenSuse
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.