Support

Admin Tools

#11443 Could not open /path/ for writing

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Tuesday, 10 April 2012 18:00 CDT

pcshost
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes what I could understand
Have I searched the tickets before posting? Yes
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: 2.51
PHP version: 5.3.6
MySQL version: 5.1.56
Host:
Admin Tools version: 2.20 pro

Other info:

cPanel Version
11.30.6 (build 3)
Apache version
2.2.19
PHP version
5.3.6
MySQL version
5.1.56
Architecture
i686
Operating system
linux Centos 5.x
Path to Perl
/usr/bin/perl
Perl version
5.8.8
Kernel version
2.6.18-194.11.4.el5PAE
cPanel Pro
1.0 (RC1)

Description of my issue:

Admin tools could not open file for writing error on Joomla Core Update. See attachment. Also I noted an error code 500 on copying for Akeeba update. For the Admin tools error I FTP'd into the site and tried creating the path and making permissions 777 to no avail. Same error. When I tried to use the admin tools FTP it displayed the same error. If I used the same info to FTP using a client CuteFTP it uploads fine.

Joomla itself when I try and update has a error code 1 copy failed error.


John
 John P.

nicholas
Akeeba Staff
Manager
John,

Your site suffers from what we call the "permissions hell" issue; different directories and files are owned by different users, which means that some of them can not be written to using direct file writes and some of them can not be written to using FTP. The easiest way to solve this is to ask your host to change the ownership of all files and folders in your account to match your FTP user, then use Admin Tools' FTP mode to upgrade your site.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pcshost
Well, having been to hell a few times I can relate. I'll give that a try. This was installed by using Fantastico and me doing manual upgrades so that would make sense. I will make the changes today and repost the results.

Спасибо.

John
 John P.

pcshost
Okay, looks like the problem could be a few things one of which is permissions. After a lot of research it seems like Joomla like nobody:nobody for folders/files and they're building it to be used more for suPHP for security so that's a few things against me I'll have to consider fixing in the future or I'll be manually upgrading forever. Go ahead and close the ticket. I'll post again if I don't figure it out any time soon. Thanks.

John
 John P.

nicholas
Akeeba Staff
Manager
It's not something Joomla! does like that and there's no way around it. It is an option. On that server you should enable Joomla!'s FTP mode in Global Configuration. Now it sounds a bit too late, but not all is lost! You can simply ask your host to change the ownership of all files and folders in your account to match your FTP user, then go to Joomla!'s Global Configuration and enable the FTP options (I've written step by step instructions in the installation troubleshooting page, under "Enable FTP"). From that point onwards, you should not have to deal with a permissions hell again.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pcshost
So you're saying I don't need to go to SuPHP in order to make these updates work? I have access to change the files and for the most part they are all changed on one site to ftpusername:ftpusername. Though it seems to have crashed the site with a 403 error if I change the sites webroot folder permissions from ftpusername:nobody to ftpusername:ftpusername so I skipped that site. I also on the previous site made all the necessary joomla folders chmod'd to 777 to verify they are writable. (I'd like to put the htaccess file in their and enable it to block outside web access after this gets working)

So I will follow the doc you sent and work on that today. Thanks.

John
 John P.

nicholas
Akeeba Staff
Manager
If your server was using suPHP and all files and folders were owned by the same user, we wouldn't be having this discussion. Either your server doesn't use suPHP, or some files/folders are owned by different users.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pcshost
Apache on my server isn't built w/ suPHP but I just might do that this weekend as I'm sure it'll be better long term. I have changed all the permissions on the site except for in the root on the mail and etc folders. All files within public_html have the same permissions. In trying to enable FTP in the Joomla configuration folder I get these errors:

JFTP::login: Unable to login
JFTP: :write: Unable to use passive mode
Could not save data. Error: Could not write to the configuration file

The configuration.php is 777 and owned by ftpusername.

 John P.

nicholas
Akeeba Staff
Manager
Hi John,

You must install suPHP. Your FTP server doesn't support passive mode, therefore you can't use Joomla!'s FTP mode. The only way to get things working smoothly is suPHP.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pcshost
Okay I will do that over the next few days once I fix everything the suPHP breaks. Thanks Nicolas, you can have the rest of the day off. ;-)

John
 John P.

nicholas
Akeeba Staff
Manager
Thanks! My day is still not over, but I'll take it easier :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pcshost
Nicholas, I'm going to do the easyapache upgrade to my CPanel server and I'm curious if there are any issues with this configuration that might conflict w/ the operation of backup pro or admin tools.

Also, once suPHP is installed can admin tools be run to change permissions as needed on 777 folders and files?

-------------
Quick concern is will sourceguardian or suhosin or suphp together cause any issues?

Configuration below:

[/var/cpanel/easy/apache/profile/_main.yaml]

Apache 2.2.22

Access

Actions

Alias

AuthzHost

Autoindex

DIR

Deflate

Expires

Fileprotect

Prevent Users from reading other webroots

Frontpage

Headers

Log Config

MemCache

Mime

Negotiation

Mod SuPHP

This option will make the following changes to your profile prior to the build:
Enables:
CGI (PHP v4)
CGI (PHP v5)

Proxy

required for cPanel/WHM/Webmail/Webdisk proxy VirtualHost support


Setenvif

Status

UniqueId

Userdir

Mod Perl

v2.0.5 - not needed to run CGI scripts

Mod Security


v1.9.5 for Apache 1.3, v2.5.13 for Apache 2.0.x, v2.6.3 for Apache 2.2.x This option will make the

following changes to your profile prior to the build:
Enables:
UniqueId

EAccelerator for PHP


v0.9.6.1 - caches compiled PHP pages ONLY when running in a persistent (DSO/FCGID) manner

Zend Optimizer/Guard Loader for PHP

3.3.9 - please read documentation that can found by clicking "More Info" to fully understand this option

SourceGuardian Loader for PHP -- 8.2 -


IonCube Loader for PHP


PHP 5.3.10

Bcmath

Calendar

CurlSSL

This option will make the following changes to your profile prior to the build:
Disables:
Curl


Curlwrappers

FTP

GD

This option will make the following changes to your profile prior to the build:
Enables:
Zlib

Gettext

Imap

Magic Quotes

Mbstring

Mcrypt

Mysql

compile MySQL support using the PHP bundled libraries (if the System MySQL option is checked it takes

precedence over this option)

Mysql of the system

compile mysql (and mysqli if its checked) support against the system libraries

Openssl

Requires OpenSSL 0.9.7 or newer

PGsql

Requires PostgreSQL 7.3 or higher to already be installed. You can do that with /scripts/installpostgres

Phar

Pspell

SQLite3

SafeMode

Sockets

TTF (FreeType)

Tidy

Wddx

Zlib

Save my profile with appropriate PHP 5 options set so that it is compatible with cpphp

This option will make the following changes to your profile prior to the build:
Enables:
CurlSSL
FTP
GD
Gettext
Iconv
Imap
Mbregex
Mbstring
Mysql
Mysql of the system
PGsql
Sockets
Zlib






 John P.

nicholas
Akeeba Staff
Manager
This looks a lot like the configuration I have on this site's server, so I guess there should be no problems :) Once suPHP is installed then yes, you can apply 0755 permissions for directories and 0644 for files. One very fine point: ownership. After installing suPHP, please make sure that all files and all directories on your account are owned by the same user as the one you use for FTP. This is the key to securing your site with suPHP.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pcshost
Aye-Aye Cap'n.

If you hear from me again that will mean I lived through the upgrade. Until then...
 John P.

nicholas
Akeeba Staff
Manager
LoL! Nobody died from a server upgrade and I'll be hearing back from you ;)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!