1

I want to deploy the Magento Core Files (Magento CE 1.7.0.2) through modman. However, when the file app/Mage.php is symlinked, the Magento Shop returns the install page.

When i restore the original file for app/Mage.php, everything works again. First, I supposed the file permissions for the symlinked file are not correct:

File: app/Mage.php

  • Symlinked: 777
  • Original: 664

However, it is impossible to change the file permission of a symlink. In Magento Backend, the setting "dev/template/allow_symlink" is true.

The file app/Mage.php defines an incorrect magento root folder, when it is located for example at magento_root/.modman/Magento_Core/app/Mage.php and symlinked into magento_root/app/Mage.php. I could reproduce this with a magento vanilla installation.

Does anybody have an idea to overcome this issue?

  • Are you sure, that the original file and the symlink have the same owner? – Fabian Blechschmidt Jul 15 '15 at 13:27
  • Yes, they have the same owner. – jhoelzl Jul 15 '15 at 14:48
  • I noticed that the symlink for app/Mage.php only works when the original file is in the same folder. For example this works fine: app/Mage.php points to app/Mage_original.php. However, my original file is located in a separate modman folder. – jhoelzl Jul 15 '15 at 15:11
  • 1
    It can be a problem, if magentos __DIR__ get problems – Fabian Blechschmidt Jul 15 '15 at 17:59
  • @FabianBlechschmidt: I think you are right; at the top of the file Mage.php, the code line define('BP', dirname(dirname(__FILE__))); unfortunately defines the magento root in the modman folder instead of the original magento root. – jhoelzl Jul 16 '15 at 5:41
1

The important file local.xml must exist in the deployed modman-Folder, otherwise Magento returns the install page: magento_root/.modman/Magento_Core/app/etc/local.xml.

Magento does not seems to use the symlinked file magento_root/app/etc/local.xml.

  • Be careful, you might get problems in other places as well, where Magento uses BP or relative paths. Deploying the core itself with modman is not advisable. Relevant: twitter.com/fschmengler/status/601728826926858240 – Fabian Schmengler Jul 20 '15 at 6:18
  • OK, thank you. I though this is "Best Practise", but you are right, then i get problems with custom template files. – jhoelzl Jul 20 '15 at 6:36
  • Actually now i found what i want: The modman module "Magento_Core" is deployed through copying files and all other modman modules are deployed through symlink. The command modman skip Magento_Core prevents this module to be deployed when the command modman deploy-all is performed. Works fine! – jhoelzl Jul 20 '15 at 12:02
  • Nice find, I did not know about modman skip – Fabian Schmengler Jul 20 '15 at 12:06
0

I'm assuming you're using apache make sure that is configured to follow symlinks as well. FollowSymLinks is the what you're looking for.

  • Thank you for this idea. I looked at my apache configuration (version 2.4.12), but i have already enabled this configuration: <VirtualHost *:80> DocumentRoot /var/www/magento ServerName dev.mydomain.local com ErrorLog logs/magento-error_log CustomLog logs/magento-access_log common <Directory /var/www/magento> Options All AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> – jhoelzl Jul 16 '15 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.