Support

Akeeba Backup for Joomla!

#40641 Could not open index.php for writing

Posted in ‘Akeeba Backup 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
5.1.0
PHP version
8.3
Akeeba Backup version
9.9.2

Latest post by nicholas on Thursday, 02 May 2024 05:19 CDT

iorbita

Hi,

I'm attempting to restore a site using Akeeba Kickstart on a test subdomain.
This subdomain was previously used successfully to restore many times the site that was in Joomla 4.

However, since the site has been upgraded to Joomla 5.1.0, the restoration fails with the following error message:

An error occurred
Could not open /home/lasapon1/beta.mywebsite.com/index.php for writing.

This suggests a permission issue, but as mentioned earlier, I've been able to restore the site to Joomla 4 on this subdomain multiple times without problems. This is the first time that I'm restoring this site on Joomla 5.1.0.

Could there be any recent changes in Joomla 5 that might be causing this conflict?

For troubleshooting purposes, I've also tried switching the PHP version from 8.3 to 8.2, but the error persists.

The .htaccess file remains the default one that comes with Joomla 5.1.0.

Any advice to help me?

Many thanks,

Lorenzo

nicholas
Akeeba Staff
Manager

This is a permissions issue, as you correctly understood the first time around. Please ask your host for help.

Most likely, when you upgraded your site FTP was involved and your server does not use PHP-FPM. As a result, the owner user and/or group of the files is such that PHP cannot write to the files directly. Your host will be able to change the ownership and permissions of existing files, making them writeable to PHP.

A very unlikely alternative is that you are out of disk space. However, given that you get an error overwriting a file with something that is if not the exact same size then just a few bytes over (we're talking about a dozen or so bytes...) I don't think that's even worth considering.

As for PHP versions, we develop our software on PHP 8.3 and test with 8.2, 8.1, 8.0, and 7.4. Besides, the PHP version alone would not result in being unable to write files. At worst, a different PHP version might not have the gzip extension enabled which would result in a different error telling you the compressed files cannot be uncompressed. However, this is ABSOLUTELY NOT the case here since you've already extracted the entire installation folder before hitting an unwriteable file, i.e. you are 100% looking at a permissions issue.

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!

iorbita

thank you Nicholas, I wrote to the host who replied that the permissions can be changed by myself via ssh or via cpanel or via the ftp application.

Obviously I've checked the permissions, but since I haven't changed anything in this folder, I can't see what I need to change in terms of permissions... I think that on a shared server these changes should be made upstream by the host?


nicholas
Akeeba Staff
Manager

Permissions and ownership. They work together to determine who can do what. Please read the Security Information chapter of Akeeba Backup.

Unfortunately, I cannot tell you what is the correct permissions and ownership for your server for two reasons. First, I have not set up this server myself. Second, I have obviously not set up this server myself, as I know how to correctly set up PHP-FPM with Apache to not have to deal with this kind of permissions hell situation ;)

What I can tell you, however, is the "Hail Mary" approach which might actually be most productive in your use case.

Before you do anything else, please make sure you have downloaded all your backup archives locally and kept a second copy of them on an external hard drive / USB key just in case.

Delete all the files and folders from your site's root. Then, upload your backup archive and Kickstart and restore 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!

iorbita

the host has fixed the problem, thank you

nicholas
Akeeba Staff
Manager

You're welcome!

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!

iorbita

Hi Nicholas,
I again wanted to restore the site in the same subdomain and again I was stuck with the same permissions problem.
I had a “heated” exchange with the hosting and after some testing they identified where the problem is.

Here is their answer:
kickstart.php is identified as malicious by imunify360, you should then contact the developer of the script and tell him to run some security tests with imunify360.

What do you think about their answer?

Thanks,

Lorenzo

nicholas
Akeeba Staff
Manager

My response to that is "What a load of utter nonsense!". Do these halfwitted mouth-breathers not realise who I am? I configure and set up my own servers, and write tutorials about it, for Christ's sake.

Kickstart has been around since 2008. It is what Joomla itself uses in the Joomla! Update component; verbatim from Joomla! 2.5.1 up to and including Joomla! 4.2.1, derivative since 4.2.2. If they cannot figure out it's not "malicious" software, they need to be repeatedly hit with a clue-by-four on the head.

I have sites on Rochen which also uses Immunify360. The script is NOT marked as "malicious" or any such nonsense, presumably because Rochen is a competent host. Apparently, your host is beyond incompetent.

But that's irrelevant, because it's all been a lie.

You have already managed to run Kickstart, therefore their claim that Immunify360 considered it "malicious" is an obvious lie. If it was marked as "malicious" it wouldn't run.

Ownership and permissions of files have sod all to do with any of what they claim, as anyone with two brain cells to rub together knows. If they are running PHP as an Apache module the only thing which determines the user and group PHP runs under is the user and group Apache itself runs under -- either as defined in the /etc/apache2/httpd.conf file, or as defined in the hosting user-specific chroot jail. If they are running PHP through PHP-FPM then it depends entirely on the PHP-FPM pool configuration.

My conclusion is that your host is completely incompetent, they run PHP as an Apache module, they do not understand how to set up cPanel so as not to create a permissions hell (even though this is a simple, and well-known configuration for the past 20 years), and they lie to you to sleaze their way out of doing what you pay them to do. Therefore, I would recommend moving to a different host.

As I mentioned already, I use Rochen without any major problems. Minor problems they fix near instantly upon submitting a ticket. Full disclosure: Rochen provides free hosting for our business site, but I am paying their full rate to host all of my other sites.

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!

iorbita

...it's clear from your reply that you're angry and that their cPanel configuration is not correct, I suspected as much...

I also forgot to tell you that one of their technicians told me that PHP-FPM setting with Apache has nothing to do with it because their server uses LiteSpeed technology and LiteSpeed doesn't work with PHP-FPM. I don't know if this has anything to do with my problem.
I hope this doesn't make you jump out of your chair again... :)

nicholas
Akeeba Staff
Manager

I am not angry, I am flabbergasted that these clowns keep lying to you because they don't understand how their own servers work, they are not doing the job they are being paid to do, and have still not figured out that I know a lot more about hosting than they do. It's not my job to fix their piss-poor hosting, but here we are.

In case these dimwits really have no idea how their server works, LiteSpeed uses LSPHP (basically, a proprietary SAPI to PHP which is conceptually somewhere between a server module and a PHP process manager) which does support suEXEC, i.e. it allows each PHP thread to run under the UID and GID of the hosting user account of a specific site. Here's the documentation: https://docs.litespeedtech.com/lsws/extapp/php/configuration/advanced/#suexec Using suEXEC they avoid the permissions hell. This operating mode predates LiteSpeed; it was called suPHP twenty-odd years ago. LiteSpeed simply uses the same trick we were using on Apache back in the earliest days of commercial PHP hosting.

All they had to do is read the f...ing manual and do the job they are paid to do.

Do you need any more proof they are beyond incompetent?

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!

iorbita

No, Nicholas, I know you're an expert on this subject.
Would you allow me to link this discussion in their support ticket?

nicholas
Akeeba Staff
Manager

It's up to you. I can already see where this is going.

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!

iorbita

... then in that case I'll avoid raising a fuss and I think I'll proceed with the change of hosting...

nicholas
Akeeba Staff
Manager

That's probably the most efficient choice, I agree.

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!

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!