Thursday, September 11, 2014

JavaScript Debug in WebStorm

To debug javascript in webstorm, we need google chrome extension After add this extension, follow the bellow step:

1. Go into 'Tool Bar' -> 'Edit Configuration' option.

2. Then Click on left most 'Plus Sign' and add 'Javascript Debug' 

           Edit the name field as you want! and then carefully add the path of your file file in the 'URL'  
Also change the 'Browser' Option into chrome.

That's all! Happy Debugging! 

Wednesday, September 03, 2014

Install xdebug for PHP5

I am going to install xdebug, please follow the bellow instruction:

1. Run this command in terminal:
          sudo pecl install xdebug

if you face problem like:
     
      Download of "pecl/xdebug" succeeded, but it is not a valid package archive
      Error: cannot download "pecl/xdebug"



Then try by the bellow command:
                   sudo pecl install -Z xdebug

2. After the command execution end, the build process complete with this command and you will see message in the terminal like bellow:

Build process completed successfully
Installing '/usr/lib/php5/20121212+lfs/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.2.5
configuration option "php_ini" is not set to php.ini location
You should add "zend_extension=xdebug.so" to php.ini


3. Then edit php.ini by the following command:

       sudo gedit /etc/php/apache2/php.ini

    and append like  bellow:

   zend_extension = /usr/lib/php5/20121212+lfs/xdebug.so

4. Then restart apache by the bellow command:

   sudo service apache2 restart


Or you may follow the xdebug wizard instruction:

                   http://www.xdebug.org/wizard.php

Sunday, June 08, 2014

Fix ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

When i had been working with nginx, i got the issue "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)" when i execute the following command:
$ mysql -u root 
Error 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
To Fix the issue, i performed the bellow command:
1. Stop mysqld deamons.
$ sudo service mysql stop
2. Go to mysql/bin directory
$ cd /usr/bin
3. Start mysql deamons with option.
$ sudo mysqld_safe --skip-grant-tables
4. Open another terminal and open a mysql session to execute this:
$ mysql
mysql> use mysql;
mysql> UPDATE user SET password=PASSWORD('YOUR_NEW_PASSWORD_HERE') WHERE user = 'root';
mysql> exit;
5. Now kill the mysqld_safe process and restart mysqld normally:  
$ sudo service mysql start
That's it. Now you can access the mysql console :)



Saturday, June 07, 2014

Fix: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

I have already apache web server installed. Then i am going to install nginx. After installation i gonna start nginx server but failed! and shows mw the following message:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

The issue is arise due to apache web server. Because i already run this within port 80. So the issue is fixed when i stop apache web server process and then start  again nginx web server. I followed the bellow command in terminal:

sudo service apache2 stop

sudo service nginx start

The above fixed my issue!

Thursday, January 09, 2014

See What Version of a Package Is Installed on Ubuntu

To check which version of package is installed in your machine, you can use a simple terminal command which is given bellow:


           dpkg -s <packagename> 


For Example, i want to see the openssl pacakage version, so that the command will looks like:

          dpkg -s openssl