Moved servers now site script won't launch site

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

My hosting service recently moved servers, and I have found out that a
website script no longer holds my website, i.e if I type in the address all
I see is:

Warning: main(/home2/username/public_html/script/inc/ failed
to open stream: No such file or directory in
/home/username/public_html/script/inc/ on line 89

Fatal error: main(): Failed opening required
(include_path='.:/usr/lib/php:/usr/local/lib/php') in
/home/username/public_html/script/inc/ on line 89

Is there a workaround to this other than reinstalling the entire script?

Re: Moved servers now site script won't launch site

Quoted text here. Click to load it

Contact your host?

Re: Moved servers now site script won't launch site

something that included:

Quoted text here. Click to load it

You've probably moved from /home2/username on the old overcrowded
server to /home/username on the new server.

There are two fairly straightforward fixes for this.

If you would the files in each directory to change home2 to home,
you'd be home free. Probably, that is. You don't know about sed, or
you'd not have asked this question, so you might well screw up the
first time you use it. And it's quite possible for someone that knows
what they are doing to screw up. I check VERY carefully before I do
something like this, and even so, I wouldn't do it unless I had
current backups. I'd advise you not to use sed.

You can do the same thing manually, with a lot more safety. Just edit
the files by hand. You don't have to open all the files in your editor
in order to determine whether the file needs editing; you can use grep

Go into each directory and type "grep home2 *".  In most directories,
I suspect you won't get ANY response. If you do get a response, you
will get a filename, followed by the line that it found "home2" on.
It's not uncommon that this information is found on only one file in
the whole site.

If you don't have shell access, you would probably need to download
the files and search the downloaded copies. The good news is that you
only have to upload the files you have edited.

You may have path information in your MySQL files. Do a dump of the
files, as if you were doing a backup, do a search/replace to change
the pathnames, then replace the old data with the modified data.

If you are comfortable working on the server and you have a shell
account, you're talking less than 20 minutes to do this, working
slowly and deliberately.

Now, I mentioned that there was another approach to solving this
problem, which is a "don't raise the bridge, lower the river"
solution. Your hosting company can create a link between
/home2/username and your new base directory. It would take you maybe
60 seconds to explain to them what you want, but only about ten
seconds to actually create the link.

I don't think you'll have trouble getting this to work, following my
directions, but if you are really apprehensive about this, it should
be pretty cheap to hire someone to fix this for you. If you have
trouble finding someone, let me know.


Re: Moved servers now site script won't launch site

Nospam wrote:

Quoted text here. Click to load it

This could also be a permissionproblem. If the site was recently moved, and
the people who did the moving accidentally forgot to give the webserver
user read access to the script in question, you may get errormessages
similar to those. Try logging in via shell access or FTP, and ensure that
everyone has read access to the script.

Tommy /

Re: Moved servers now site script won't launch site

Nospam wrote:
Quoted text here. Click to load it

Sounds like you're hard coding the path in your script.  Bad move.

Rather, you should code absolute paths based on the server's document
root (assuming you use Apache).  So it should be something like:

   $_SERVER['DOCUMENT_ROOT'] . /script/inc/

This would work on any Apache server.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline