8

When i am installing an extension in my magento admin,it shows Connection string is empty. I don't know why this problem occurs. I cleared the cache also then also the problem is same. If anyone knows how to do this,please help me out. Thanks!

Prince Kumar
  • 498
  • 3
  • 9
  • 30

6 Answers6

12

To solve this problem, follow the steps below (I suppose you are using Ubuntu):

1) sudo chmod -R 777 /var/www/html/magentoInstallationFolder/

2) Install Magento Extension

3) Restore correct permissions for directories and files respectively

sudo find /var/www/html/magentoInstallationFolder/ -type d -exec chmod 775 {} \;
sudo find /var/www/html/magentoInstallationFolder/ -type f -exec chmod 664 {} \;

Read more about why 777 permissions are bad and you need to restore good permission code (775) after you install the extension: https://askubuntu.com/a/30635

Community
  • 1
  • 1
pablofiumara
  • 1,747
  • 1
  • 16
  • 24
3

Magento tries to put the maintenance flag in the root directory. Here is the code that does it:

<?php
//downloader/Maged/Controller.php::startInstall()
if ($this->_getMaintenanceFlag()) {
...
//downloader/Maged/Controller.php::isWritable()
$this->_writable = is_writable($this->getMageDir() . DIRECTORY_SEPARATOR)

If you can't change magento root directory permissions just uncheck "Put store on the maintenance mode while installing/upgrading/backup creation" flag.

Cmyker
  • 2,318
  • 1
  • 26
  • 29
2

There's a couple of suggestions to change the permissions to this:

sudo chmod 777 -R /var/www/html

Which is a really really bad idea. Have a search for 'Magento permissions' and follow the guide instead. Unless you're seeking to get your site hacked wihin a few minutes.

0

Have to change right recursively (chown -R) to www-data:www-data on a directory containing magento (example : /var/www/magento) Sorry for bad engish

0

chown -R www-data:www-data /var/www/your_magento_folder That did the tick for me, don't change the owner of the www folder

-3

Type the following command in your terminal.

sudo chmod 777 -R /var/www/html/<magento folder name>. Press Enter.

Then it will ask for password if exists for your username.

Once it is done, login and logout the admin and try to install extension which you want

Edited:

Try this for your files:

sudo chmod 777 -R /var/www/html

and follow the above steps.

Pavan Kumar
  • 1,735
  • 2
  • 28
  • 47