[wp-hackers] Force a new ABSPATH when moving WordPress?

onlyunusedname onlyunusedname at gmail.com
Wed Mar 21 20:19:47 UTC 2012


Excellent.  Thanks, Otto.  There is eAccelerator running on this server and
clearing its cache is just the trick.

Just out of curiosity:  If one wanted to write a script that did everything
in a more environment agnostic fashion, would that be possible?

In other words, this script would run once after a URI change and it would:

1) Change the relevant database entries from $old_url to $new_url.

2)  [Magically solve a cached ABSPATH problem in a reasonably environment
agnostic fashion]

3) Redirect to $new_url  (Site successfully moved.)


Is step 2 as preposterous as I am making it sound, or can you imagine a
feasable-ish answer?

Thanks in any event.  You helped me a ton.



On Wed, Mar 21, 2012 at 3:54 PM, Otto <otto at ottodestruct.com> wrote:

> Most likely, you're running some sort of PHP accelerator, which keeps
> the "compiled" PHP files in memory instead of re-reading them every
> time. Thus, a change to the PHP files requires you to restart the
> server to get the old versions out of RAM.
>
> Look into what PHP accelerator you're running, and see if it has any
> way to flush the cached data.
>
> -Otto
>
>
>
> On Wed, Mar 21, 2012 at 2:04 PM, onlyunusedname
> <onlyunusedname at gmail.com> wrote:
> > I have a quick question that may be more PHP than WordPress.
> >
> > Whenever I move a small WordPress site database inclusive (and by move, I
> > mean change its path and URI), I usually just change all the references
> to
> > the domain in the database with a search and replace.
> >
> > This seems to work for my needs, but the problem I run into every time is
> > that wp-config.php retains the old ABSPATH constant.  So the site won't
> > load at all at first.  My solution to this has always been to restart
> > Apache.  After I do that wp-config.php will re-define ABSPATH correctly
> and
> > everything works fine
> >
> > Is there a way I can force this to occur without restarting my server?
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list