4

Previous title: Can't install extensions: Error: Archive does not exist

I removed and reinstalled Joomla 3.3.6 on my CentOS 6.5 server. Wanted to install some backup utilities and a CCK. However i'm stuck trying to install extensions getting errors like:

Error
Archive does not exist

Warning
JFolder: :files: Path is not a folder. Path: /var/www/html/jrt/install_54b9d8947a105
JFolder: :folder: Path is not a folder. Path: /var/www/html/jrt/install_54b9d8947a105
JFolder: :files: Path is not a folder. Path: /var/www/html/jrt/install_54b9d8947a105
JInstaller: :Install: Cannot find Joomla XML setup file

This screams permission error but this is the permission on the jrt(tmp) folder

drwxr-xr-x.  2 root root  4096 Jan 16 22:32 jrt

Most of the suggestions for this are to set it to 777 but I should think that to be a bad practice and it does not work anyway. I am used to NTFS permissions and I think I need to set the permissions on the children of this folder but its contents are empty to there is nothing to change?

I've seen this sad story a few times on the web and its path or permissions related. I know the path exists as if I delete the folder I also get the error

JFolder: :folder: Path is not a folder. Path: /var/www/html/jrt

I don't know if there is more to testing this but PHP Handler also came up in research and since I did update PHP so that I could run this version of Joomla perhaps it is also a culprit. To test I created a small php file

<?php
   print "hello world";
?>

To see if it would display "hello world" which indeed it did.

PHP ini

An answer asked me to change to PHP.ini settings. Here is what I changed from the defaults. Making changes here does not rectify the errors.

upload_max_filesize = 10M
post_max_size = 11M
max_input_time = 300
max_execution_time = 120
default_socket_timeout = 120

Permissions

After checking the correct part of the admin console System > System Information > Directory Permissions not a single entry here is listed as writable. Do I need to edit each folder tree? Again I don't think that setting 777 on these folders is a good idea ( or work ). For example it list my temp folder as unwritable but it looks like the correct permissions above.

I tried also to change the group owner on the html root folder so now all folders and files have apache as a group. No change so far.

Apache errors

This is what I get when I try to install an extension

[Sat Jan 17 19:24:02 2015] [error] [client 123.123.123.123] PHP Warning:  file_put_contents(/var/www/html/jrt/plg_webinstaller_3.2v1.0.5.zip): failed to open stream: Permission denied in /var/www/html/libraries/joomla/filesystem/file.php on line 431, referer: http://mywebsite.ca/administrator/index.php?option=com_installer
[Sat Jan 17 19:24:02 2015] [error] [client 123.123.123.123] PHP Warning:  array_merge(): Argument #1 is not an array in /var/www/html/libraries/cms/installer/helper.php on line 154, referer: http://mywebsite.ca/administrator/index.php?option=com_installer
[Sat Jan 17 19:24:02 2015] [error] [client 123.123.123.123] PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/libraries/cms/installer/helper.php on line 207, referer: http://mywebsite.ca/administrator/index.php?option=com_installer
[Sat Jan 17 20:39:06 2015] [error] [client 123.123.123.123] PHP Warning:  file_put_contents(/var/www/html/jrt/plg_webinstaller_3.2v1.0.5.zip): failed to open stream: Permission denied in /var/www/html/libraries/joomla/filesystem/file.php on line 431, referer: http://mywebsite.ca/administrator/index.php?option=com_installer
[Sat Jan 17 20:39:06 2015] [error] [client 123.123.123.123] PHP Warning:  array_merge(): Argument #1 is not an array in /var/www/html/libraries/cms/installer/helper.php on line 154, referer: http://mywebsite.ca/administrator/index.php?option=com_installer
[Sat Jan 17 20:39:06 2015] [error] [client 123.123.123.123] PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/libraries/cms/installer/helper.php on line 207, referer: http://mywebsite.ca/administrator/index.php?option=com_installer
4

Big shout to @VilleNiemi for his troubleshooting getting me on the write path. ( Yes I used write instead of right as a pun.) My Directory Permissions appeared to be the source of my problem.

Unwritable

Solution if host is dedictated

I thought that changing the changing the group from root to apache would fix the issue but nothing changed. After reading another post on Joomla Forum I saw someone change the owner of the folders and files. So after I ran the following

sudo chown -R apache:apache /var/www/html/

Then, after refreshing my screen, I see the colour green again.

Green is good

So the files on the root of my web directory are set for permissions with 744. Folders with 755 and files in said folders are 644. Think I'm all set for now.

Succesfully installed the first plugin on my site. Off to the races with me!

Solution if shared host.

Will post something more verbose once its complete but a good read comes from Dionysopoulos which is linked in this answer 4. It talks about permission pitfalls and why my dedicated host solution is bad in general and especially bad for shared host providers.

  • Cool. I feel bad for pointing out that that is not the best solution to the issue, see the links in my comments on my own answer. But most of the issues with setting owner to apache are on shared servers, if you are on a dedicated server, pat yourself on the back. Apologies on wasting your time on getting sidetracked, the permissions issue is so common that I actively try figure out some other explanation even when I really should not. – Ville Niemi Jan 18 '15 at 10:34
  • @VilleNiemi If I was on a share host I would effectively be giving other websites access to mine correct? I will take another look at the links you sent. I was fixed on the permissions issue so I could not make a link between how what you were asking me to do would fix that issue. Waiting for comments like this is why I have not accepted this answer. Thank You – Matt Jan 18 '15 at 14:21
  • Yes, that is the problem as all sites would run with the same user and have the same rights. I don't do server management myself, but I have noticed that the few servers I used with this configuration had pretty often issues with hackers... Although they blamed the users not updating their applications, of course... – Ville Niemi Jan 18 '15 at 14:26
2

The "archive does not exist" kind of suggests that Joomla! failed to upload the archive. Which leads to the archive failing to decompress and the contents not being moved to the expected folder. Which means the expected folder will not exist.

Either your PHP has an upload limit that is too low for the files in question or your tmp path is incorrect. If you installed PHP yourself, the relevant settings are probably still at their defaults which are 2MB and too small. In php.ini set upload_max_filesize and post_max_size to some higher value.

While you are at that also increase max_execution_time as it causes very annoying issues if it times out in the middle of installs or updates.

  • I had already changed upload_max_filesize to 10m but I will check the other settings. Thanks. Will let you know. – Matt Jan 17 '15 at 16:33
  • I edited my answer with the changes you requested ( and a couple of more ). Did not change anything as I still get those errors. The packages I was testing were "Joomla! Extensions Directory (JED)" and "Akeeba Backup". Let me know if there is anything else you can think of. – Matt Jan 17 '15 at 17:03
  • @Matt If all folders are unwritable I am guessing you did the reinstall using command line and use PHP thru the Apache API? In such case the owner and group of the files might be different from what the Apache and PHP uses. CHOWN would help with that. – Ville Niemi Jan 17 '15 at 17:25
  • 1
    @Matt Depends on how Apache is setup. Did you check if PHP is set thru mod_apache? php.net/manual/en/function.get-current-user.php – Ville Niemi Jan 17 '15 at 17:36
  • 1
    @Matt forgot to (at) you, read the comment above. Also, I forgot to mention this in the question I linked to but I think it might be useful to chown the cache directory even if you use FTP as I seem to recall that tries to use PHP anyway. And centoshelp.org/servers/web/installing-configuring-suphp – Ville Niemi Jan 17 '15 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.