Saturday, September 28, 2013

Fatal error: session_start(): Failed to initialize storage module: files (path: ) in /usr/share/phpmyadmin/libraries/session.inc.php on line 81

 Fatal error: session_start(): Failed to initialize storage module: files (path: ) in /usr/share/phpmyadmin/libraries/session.inc.php on line 81

Solution : 1
Add the parameter in the file php.ini
session.save_path = "/tmp"
Restart apache.

Solution : 2
If you are using Debian or Ubuntu and you have tried solution : 1 and  it still shows above error, remove following lines from /etc/phpmyadmin/apache.conf
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_admin_flag allow_url_fopen Off
php_value include_path .
php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/
</IfModule>

Now restart apache2 & mysql and try again.

phpmyadmin - max upload file size is not changed

phpmyadmin - max upload file size is not changed after making changes in php.ini

If you have changed upload_max_filesize & post_max_size both parameters in php.ini but still it does not show changed maximum upload file size in import section.

You have restarted apache and you have done every thing what was suggested to you but still you are unable to see increased max upload file size.

 Now you are at correct place, just follow this.

Make a file .htaccess and put following text in it.
php_value upload_max_filesize 2048M php_value post_max_size 2048M
where 2048M is your max upload file size, you can set whatever value you want.

Put this file into phpmyadmin directory.

Now restart apache and mysql and see import page of phpmyadmin. It will show the limit you have put in .htaccess file.

The path of phpmyadmin directory is /usr/share/phpmyadmin. If you are using LAMPP, the path of phpmyadmin directory is /opt/lampp/phpmyadmin

Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration Action 'configtest' failed.

Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed. The Apache error log may have more information....fail!

Ubuntu - Apache2 error

If you are getting this error, it means you have used rewrite engine in your script but rewrite module is disabled right now.

To solve this error, just enable the rewrite module.

If you are using ubuntu - apache2, run this command in terminal
# sudo a2enmod rewrite # service apache2 restart
Now try again.

If you are getting this error in RHEL/CentOS or in LAMPP, click here.

Enable and Disable Apache modules

Enable and Disable Apache modules in Ubuntu or CentOS

If you want to enable or disable any module in Apache, this post may be helpful for you.

Enable or Disable Apache module in RHEL or CentOS

In CentOS, we can see all Apache modules in the directory /etc/httpd/modules.
These modules are enabled in the file httpd.conf using following code. 
Here is an example of rewrite module.
LoadModule rewrite_module modules/mod_rewrite.so
If you want to disable this module, just comment the line and restart Apache, now it does not load the module.

If you want to enable it again, just uncomment the line and restart apache. 
Using this method we can enable and disable any module of Apache on CentOS.

Enable or Disable Apache module in LAMPP

The process in LAMPP in same as CentOS.
All modules are mentioned in the file /opt/lampp/etc/httpd.conf
If you want to disable any module, just comment the line and restart LAMPP, now it does not load the module.

If you want to enable it again, just uncomment the line and restart LAMPP. 
Using this method we can enable and disable any module of Apache in LAMPP.

Enable or Disable Apache module in Ubuntu

If you want to disable apache module in ubuntu-apache2, run following command
$ sudo a2dismod module_name

If you want to enable apache module in ubuntu-apache2, run following command
$ sudo a2enmod module_name

Suppose you want to disable or enable rewrite module, you should run :
$ sudo a2dismod rewrite $ sudo a2enmod rewrite



Saturday, September 14, 2013

unetbootin error - 7z not found. This is required for either install mode. Install the "p7zip-full" package or your distribution's equivalent.

unetbootin error - 7z not found. This is required for either install mode. Install the "p7zip-full" package or your distribution's equivalent.

If you are trying to make a bootable pen drive using Unetbootin and it gives you above error.
Now because of this error you are not able to make bootable pen drive, here is the solution for you.

If you are using debian or ubuntu
Install from command line
# sudo apt-get install p7zip
OR
If you are still getting the problem
Go to this link and download the p7zip according to your configuration.

Here you can download the deb file.

Now install it and try to make bootable pen drive again.

You will not get this error.

NOTE : If your machine is 32 bit machine, download i386, if you are using amd 64 bit, download amd64 version.

You can find these links at bottom of the page.

If you are using CentOS or Fedora
Install from command line
# sudo yum -y install p7zip

Run a Shell script in a Perl script

Call a Bash script in a Perl script
Run a Shell script inside Perl script
Execute Shell script in a Perl script

If you making a perl script and somewhere you want to run a bash script inside that perl script.

It can be done easily through the following piece of code.

Here is a example of an infinite loop in shell script which prints 0 infinite times.
If you run this shell script statement in terminal, it gives you 0 infinite times.
while [ 4 -le 5 ]; do  echo 0;  done;

Suppose I want to run this Shell script from a Perl script, Now I add this line of code in my perl script.

system("bash -c 'while [ 4 -le 5 ]; do  echo 0;  done;'");

Now My Perl script runs this shell script code.

Suppose this line of code is saved in a shell script file as script.sh, now if I want to run this shell script from my perl script.

I simply add this line of code in my Perl script.
system("bash -c '/root/Desktop/url.sh'");