Re: php.ini include_path and symlinks
| From: | Robert Cummings | Date: | Wed, 07 Nov 2007 02:46:48 +0000 |
| Subject: | Re: php.ini include_path and symlinks | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-264158@lists.php.net to get a copy of this message | ||
On Tue, 2007-11-06 at 18:35 -0800, Ravi Menon wrote:
> Hi,
>
> We run php 5.2.0 + apache 2.2. with apc turned on ( apc.stat also on
> ). Earlier we did not use the php.ini include_path setting. We relied
> on some symlinks for our common code
> so that require_once works correctly.
>
> This worked fine and during code releases we flipped the main
> 'release' symlink atomically, without restarting apache.
>
> Later we decided to use php.ini include path to refactor common code
> more cleanly and it looks like:
>
> include_path=.:/some/dir/current:......
>
> Now 'current' above is a symlink.
>
> When we push out a new release the current is updated atomically and
> apache is not restarted.
>
> This seems to pick the new changes and I ran some manual tests to
> confirm. However occasionally I see weird
> errors where it seems php could be resolving the symlink to the actual
> dir. at apache startup, and it assumes
> that old dir. When a new release goes out, we see 'fatal redeclare errors' etc..
>
> Restarting apache (TERM and not USR1) seems to fix it.
>
> We could update our install scripts to restart apache, but I am just
> curious, is this really necessary?
>
> Is there anyway to prevent php from not resolving symlinks but use
> them as it is in the include_path?
Are you using a compile cache like eaccelerator or APC etc? Sometimes
it's the cache that doesn't realize things have changed. I use a symlink
switcher for version releases also and I always flush the eaccelerator
directory when I do that.
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................