0

I have several virtual host with each there folder. And a single shared folder:

/home/website1
/home/website2
/home/website3
/home/shared_src

Symlinks works fine inside each folder to a per website folder called "codebase".

I have copied the folder "codebase" to /home/shared_src and would like to use a symlink to access the /home/shared_src_codebase from each of the other websites. But wh ndoing this I get:

PHP Fatal error:  Cannot redeclare class [patch and class...]

What shall I add to the apache configuration to allow symlinks to the shared_src folder outsite the web root?

I need to do this for apache on a debian server. I have tried using alias as descriped here. Either that is not the trick, or I did it wrong: Security of symlink to directory outside webroot set to 777?

On another system I once used (based on CentOS) the setting was called PHPBaseDir. On debian I do not know...

UPDATE WITH MORE DETAILED INFO

Mainly bug was caused by the symbolic link beeing linked to a folder named the same as a physical folder inside the website folder.

/home/website1/typo3_src-6.2
/home/website/typo3_src -> /home/sharedsource/typo3_src-6.2 (symlink)

That is fixed and now I get this ind the apache log:

[Wed Jan 15 09:48:17 2014] [error] [client xx.xx.xx.xx] PHP Fatal error:  require_once(): Failed opening required '/home/cstmr_opengate/band.opengate.dk/website/typo3_src-6.2.0beta3/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php' (include_path='/home/cstmr_opengate/band.opengate.dk/website/typo3/contrib/pear/:.:/usr/share/php:/usr/share/pear') in /home/x_src/typo3_src-6.2.0beta3/typo3/sysext/core/Classes/Core/ClassLoader.php on line 178

So issue is probably not the symlinking it selv. Cause symlink is followed to the shared folder. It is the error that is thrown after the the symlink is beeing used...

4
  • You now have a very specifc error message. Just check if the path to PackageManager.php is valid, and apache has permission to read it.
    – AndreasT
    Jan 15, 2014 at 10:15
  • Solved: It was a caching issue witin the webapplication that used the shared source. It could not load until some overlooked cache files were deleted. Not a debian, apache or symlink uissue after all
    – Tillebeck
    Jan 15, 2014 at 11:51
  • @Tilebeck, please post your answer as an answer, rather than as part of the question.
    – tombull89
    Jan 15, 2014 at 12:13
  • Welcome to Server Fault. Please do not tag questions with "SOLVED" or place answers in the question. Instead, post your own answer as an Answer below, and mark them solved by clicking the outline of the tick mark so that it turns green. Aug 2, 2014 at 21:03

1 Answer 1

0

There are two apache ways to do this, which can be found under the following link: Apache Docs

Basically, either use the Option FollowSymlinks in the <directory> section, or define an alias to the directory.

1
  • Yes, I have tried both with not much luck. I stick to the symlink right now and the symlink is followed whereafter something goes wrong. I cannot understand the error message.
    – Tillebeck
    Jan 15, 2014 at 9:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .