News:

Join the Facebook Fan Page.

Main Menu

File Path issues

Started by Saxon044, August 26, 2015, 05:49:43 PM

Previous topic - Next topic

Saxon044

Without notification my ISP migrated my website to a new Windows2012 server, and also moved the MySQL forum database onto the same server (previously it was on a dedicated MySQL box). The sql server name needed to change from 'MySQL5' to 'localhost'. Obviously this killed the forum until I changed the file paths and server name.

Unfortunately the ISP was not very clear when they passed me the new file path. Originally E:\domains\my.url\wwwroot\4rum. The new path info they sent me is E:\domains\my.url\httpdocs\my.url\  Since I can still see wwwroot in ftp I presumed that this needed to be appended to the path provided (E:domains\my.url\httpdocs\my.url\wwwroot\4rum) and set the forum paths accordingly. In fact it seems that 'wwwroot' is an alias for the second instance of my.url and so the wwwroot should not be included.

In the broken state logins were extremely flakey but I managed to reset the paths in Admin>Server Settings>Database and Paths. Not much better.

I uploaded and ran repair_settings.php, but after changing the paths it seemed to just hang, and subsequent accesses caused a 404.

I have manually changed the entries in \4rum\Settings.php by removing the extraneous \wwwroot that I added by mistake, so those paths are definitely correct now.

In phpadmin I ran a search for all instances of 'wwwroot', then edited the fields to remove the wwwroot in those paths.

Login was still flakey so I changed the cookie name and now login is fully functional.

Themes, avatars, smilies etc all working correctly.

The only remaining issue is that posting produces an error and no new posts can be made:

"Field 'edit_reason' doesn't have a default value
File E:\domains\my.url\httpdocs\my.url\4rum\Sources\Subs-Post.php
Line: 1824"

Now when I was on RC3 I did have 'reason for edit' mod installed but when upgrading to 2.0.9 it wouldn't reinstall (wrong version) and so I left it off. This has been causing no issues at all.

I have now tried the 'emulate 2.0.3' trick, installed 'reason for edt' mod successfully. I was able to insert reasons for editting in existing posts. Still the new posting error.
Changed the emulate back to 2.0.9. No better.
Back to 2.0.3 and uninstalled the 'reason for edit' mod cleanly. Still the posting error.

I have run all the repair/maintenance routines in Admin. No change (and no errors either).

Repair-settings.php still 404s, Settings.php is in the same folder, set to 666, also Settings_bak.php but this has the incorrect paths.

I have now run out of ideas. Might there still an incorrect file path buried somewhere that I haven't found? Or is there a different issue?

Sir Osis of Liver

Link to your forum?
Is repair_settings.php still in your forum root?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Saxon044

#2
Yes, repair_settings.php is still present.

Illori

Quote from: Saxon044 on August 27, 2015, 04:14:37 AM

Yes, repair_settings.php is still present.

you should never leave repair_settings.php present after you have used it, it is a security risk.

as a result i have removed the link to your forum.

Saxon044

OK, thank you. I was aware of the security implication but since repair_settings just 404s it didn't seem to matter much. I haven't seen a solution to this 404 problem yet, I can't make sense of it because the file is present.

Kindred

well, if the rest of the system is working correctly, then don't worry about repair_settings.php - just delete it.

regarding your error.
installing and uninstalling won't fix anything, since the code is obviously left over from a partial install/uninstall -- and the full install will add new code (and the full uninstall will then remove that new code)

You need to go into the file - Subs-Post.php - around Line: 1824 and remove the reason-for-editing code...
You will probably have to parse the whole mod and MANUALLY remove -- or change back to default -- the code that is left over from the mod
Сл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."

Saxon044

Thanks Kindred. I have copied in a Subs-Post from a test installation, but the error remains. I don't see any sign of 'edit reason' in the file. Baffled. I have attached the file that is currently in use.

Kindred

actually...    if they changed your servers, the paths may have changed.

use repair_settings.php to confirm that your forum paths match the new server.
Сл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."

Illori

Quote from: Saxon044 on August 27, 2015, 06:20:12 AM
OK, thank you. I was aware of the security implication but since repair_settings just 404s it didn't seem to matter much.

the user cannot physically run the file due to the 404 error.

Kindred

whoops...

Actually, it is definitely sounding like the host screed something up during the server move -- especially if they changed form a linux server to a windows server.

Сл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."

Saxon044

Can't figure out why repair_settings 404s, does anyone have an answer to this one?

But anyway, I have the correct paths in Admin>Server Settins>etc...
The correct paths are present in Settings.php
I have also checked all paths correct in the db tables

Are paths defined anywhere else?

Sir Osis of Liver

Can you run anything in your root directory?  If you get a 404 trying to run repair_settings with a direct link, there's a problem serverside, as Kindred posted.  Your host may have set a bad redirect from old to new server address.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Saxon044

Yes, other files do something, GiveReputation.php displays a setting screen, other files provoke 'hacking attempt'. It is just repair_settings that 404s.

Sir Osis of Liver

Can you manually fix the settings in Settings.php?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Saxon044


JBlaze

The only reason a file would 404 is because it was uploaded to a different directory than is being called. So if you uploaded it to example.com/repair_settings.php and are trying to access it via example.com/forum/repair_settings.php, then it would for sure give you a 404 error.

The only other explanation I can think of is either the server or your browser is forcing an errant redirect somewhere. I'm not familiar with how IIS/Windows does redirects, so you will definitely have to check with your host. However, if it's your browser, a simple cache clear should do the trick.
Jason Clemons
Former Team Member 2009 - 2012

Sir Osis of Liver

If you can pm ftp access, I'll have a look.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Saxon044

Defo in the root of the forum.

I considered a possible browser cache issue and so tried in two other browsers that I don't usually use, same result.

Sir Osis of Liver

Try running phpinfo.php (attached) in your forum root.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Saxon044

Interesting, phpinfo also 404s.

Double checked another file (GiveReputation.php) also in forum root, works fine.

Advertisement: