Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > php.ini include_path and symlinks
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 26th October 00:26
jravimenon
External User
 
Posts: 1
Default php.ini include_path and symlinks



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?

Thanks,
Ravi
  Reply With Quote


 


2 26th October 00:26
robert
External User
 
Posts: 1
Default php.ini include_path and symlinks



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!
.................................................. ..........
  Reply With Quote
3 26th October 00:31
jravimenon
External User
 
Posts: 1
Default php.ini include_path and symlinks


Yes we use APC ( with apc.stat on ). This was the case even before we introduced
include_path, but earlier, all the symlinks were to a relative path (
e.g. libraries ---> ../libs/.. ).

Thanks for the pointer - I will look into this.

Ravi
  Reply With Quote
Reply


Thread Tools
Display Modes




666