martes, 7 de mayo de 2013

Codeigniter how remove index.php from url

Codeigniter 2.1.3

To remove index.php from url you need to create a .htaccess with this code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /codeigniter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /codeigniter/index.php
</IfModule>
Modify /codeigniter with your project path.
My project path is /var/www/codeigniter/ so... 
Put it in your project root directory. 
Check if mod_rewrite is enabled. You can create a php file with the next code:
<?php phpinfo(); ?>
and in Loaded Modules section check if is loaded mod_rewrite. Or:
if (in_array('mod_rewrite',apache_get_modules())) {
    echo "mod_rewrite loaded";
} else {
    echo "mod_rewrite not loaded";
}
If mod_rewrite is not loaded
sudo a2enmod rewrite
restart apache
sudo /etc/init.d/apache2 restart
if it doesn't work, you need to enable at least  
AllowOverride FileInfo and Options FollowSymLink 
to your Apache configuration file.
/etc/apache2/sites-available/default

Ok, now you can say good bye to index.php 


sábado, 2 de febrero de 2013

Linux Mint 14 XFCE missing title bar and context menu

I had a rare problem. When Mint started and I executed an app eg Firefox, the app doesn't had the title bar! So, I couldn't min, max or close the window. In the "Taskbar" doesn't display anything and the app stayed static. I don't know what was the problem here, but i can solve it with one line command. Open the terminal and put: xfwm4

that's all folks! 


I found the solution here
All credits for menta3 from http://www.linuxmint-hispano.com

domingo, 16 de septiembre de 2012

Install XDebug in Linux Mint

Xdebug is a open source tool that allows debug our php applications, I use it a lot with Netbeans.
The current version is 2.2.1 and I will show you how install and use it.


UPDATE:
I don't know why,  but i had problems with a new installation on ubuntu. The solution was use:
sudo aptitude install php5-xdebug
and
sudo nano /etc/php5/conf.d/xdebug.ini

add the follow:
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

then restart apache with:
sudo /etc/inid.d/apache2 restart

And it should works



* OLD METHOD

Xdebug needs two modules to compile: php5-dev and php-pear.
We will use apt-get to install these modules:

sudo apt-get install php5-dev php-pear

Now, we can download and install Xdebug:

sudo pecl install xdebug
(When xdebug finishes to install it shows us the path where is xdebug.so, copy it)

Then, we must configure Xdebug in php.ini to it works.

sudo nano /etc/php5/apache2/php.ini

and add this lines on the end:

zend_extension=/usr/lib/php5/<DATE+lfs>/xdebug.so
xdebug.remote_enable=on

Where <DATE+lfs> is the name of the folder that I mentioned previously on the xdebug installation.

Notes:
If you couldn't copy the xdebug.so path go to: /usr/lib/php5/ and search the folder where its name is like this: /20090626+lfs/
The +lfs in the name is always.