News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Permissions Issues Following 2.0.19 -> 2.1.4 Upgrade

Started by von Corax, September 02, 2023, 03:23:54 PM

Previous topic - Next topic

von Corax

I've just upgraded to SMF 2.1.4, and now I can't install any mods and repair_settings.php does not make any changes. I know this is a broad question, but what should I look at first?

When I try to upload a package from the Add Packages page I get the error "The package you are trying to install cannot be located. You may want to manually upload the package to your Packages directory.", and the error log records
2: move_uploaded_file(/CountryFlags_v3.0.zip): Failed to open stream: Permission denied
2: move_uploaded_file(): Unable to move '/tmp/phpoxgxpe' to '/CountryFlags_v3.0.zip'

Thanks,
Darwin

Kindred

looks like you have some permissions problems. I'd suggest checking with your host
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

von Corax

I just spotted the problem, but I don't know what to do about it. It appears SMF is attempting to move the mod archive into / (root) instead of /home/<user>/public_html/forum/Packages . When I try to set the Packages path, repair_settings.php does not save the setting.

Sir Osis of Liver

When in Emor, do as the Snamors.
                              - D. Lister

von Corax


Sir Osis of Liver


 * Path to the Packages directory.
 *
 * @var string
 */
$packagesdir = '/home/<user>/public_html/forum/Packages';
/**


If it's not there, try adding it.

When in Emor, do as the Snamors.
                              - D. Lister

von Corax

Is it a problem that my Settings.php file still says "@version 2.0"?

Sir Osis of Liver

2.0 Settings.php does not contain $packagesdir, it was added in 2.1.  Upgrade.php should have updated the settings.  How did you upgrade to 2.1.4?
When in Emor, do as the Snamors.
                              - D. Lister

von Corax

Quote from: Sir Osis of Liver on September 02, 2023, 06:43:54 PM2.0 Settings.php does not contain $packagesdir, it was added in 2.1.  Upgrade.php should have updated the settings.  How did you upgrade to 2.1.4?


I unpacked the 2.1.4_upgrade archive, copied the files overtop of my installation, and then ran upgrade.php. I did have to disable_security to get past the login page.

Sir Osis of Liver

It seems that Settings.php wasn't upgraded, and repair_settings can't fix it.  Save a backup of Settings.php, replace it with clean file from 2.1.4 install package (attached), run repair_settings again.  If that doesn't work, you'll have to edit it manually.  Most of the settings will be the same as 2.0.
When in Emor, do as the Snamors.
                              - D. Lister

von Corax

Now I can't access the forum at all. :'(

EDIT: Found that Settings.php (the new one) had an unpaired right brace on line 266. Placing a left brace at line 258 has at least fixed that problem and restored access to the forum. However, I now get the warning, "Unable to set authentication secret in Settings.php. This weakens the security of your forum and puts it at risk for attacks. Check the file permissions on Settings.php to make sure SMF can write to the file."

live627

Can you restore your file. Your copy includes your database credentials; the one attached above is a clean one from the install pack. Don't use it.

Does yours have $packagedir somewhere in it, probably at the end? Can you post that single line only?

Quote from: von Corax on September 02, 2023, 06:34:09 PMIs it a problem that my Settings.php file still says "@version 2.0"?
No, not really: the upgrade script already updated that file. For example: my test site has started with SMF 2.0 RC3 and is now on 2.1.2; Settings.php still says SMF 2.0 RC3 but has all required variables.

von Corax

My Settings.php following the upgrade was unmodified from before the upgrade. If you want I can post it after obfuscating the sensitive bits. My forum is currently running with the file provided by Sir Osis, modified by repair_settings.php, but the forum software itself seems unable to modify Settings.php; for example, I cannot set Maintenance Mode from the Server Settings page, and I'm constantly getting the warning,
QuoteUnable to set authentication secret in Settings.php. This weakens the security of your forum and puts it at risk for attacks. Check the file permissions on Settings.php to make sure SMF can write to the file.

Sesquipedalian

Sounds like a file permissions error.  You need to make sure Settings.php and Settings_bak.php are both writable by the user under which the web server process runs.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

von Corax

Quote from: Sesquipedalian on September 03, 2023, 02:00:45 AMSounds like a file permissions error.  You need to make sure Settings.php and Settings_bak.php are both writable by the user under which the web server process runs.

I set the permissions on Settings.php to 666 and it made no difference. I don't seem to have a Settings_bak.php.

Doug Heffernan

Quote from: von Corax on September 03, 2023, 02:10:14 AMI set the permissions on Settings.php to 666 and it made no difference. I don't seem to have a Settings_bak.php.

Can you try a full chmod instead (777)?

von Corax

Quote from: Doug Heffernan on September 03, 2023, 04:49:32 AM
Quote from: von Corax on September 03, 2023, 02:10:14 AMI set the permissions on Settings.php to 666 and it made no difference. I don't seem to have a Settings_bak.php.

Can you try a full chmod instead (777)?

That didn't work either.

m4z

Are the permissions on the forum dir itself correct (does the webserver user or group have write permissions)?
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

von Corax

Quote from: m4z on September 03, 2023, 10:11:35 AMAre the permissions on the forum dir itself correct (does the webserver user or group have write permissions)?

That didn't make any difference either.

m4z

I'm unsure what your test setup is. I assume you're doing the following: 1.) Change the permissions, 2.) Re-run repair_settings, 3.) Attempt to change something from the SMF admin area.

Is that correct?
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Advertisement: