Newscoop 4.3 (Debian Wheezy 64) - Memory limit with Composer & plugin installation
  • Hello, installing plugins from the admin panel is producing the above composer  memory limit error (nothing in the Apache2 log with no error message in the Apache2 error.log file, and trying to install the plugins directly using either php or by adding Packagist to the dependencies installed by composer.json is also producing errors - I have tried all of the "fixes" for Composer recommended at: https://github.com/composer/composer/issues/2704 (including increasing the memory limit in php.ini and also php.ini cli version where I have changed memory limit to -1 (unlimited), and also trying to limit the memory php phar.update uses by running php -dmemory_limit=1G composer.phar update in the console. I have 6Gb or Ram on my VPS box and even setting the limit to 5Gb is producing the same error!

    The problem seems to be with Composer rather than with 4.3 but I'm wondering if you have a workaround (is the version of Composer specified in composer.json the correct one - when I try upgrading Composer it produces dependency errors!

    Blank screen on installation - PDO exception error after upgrading problems - despite running everything as the Root user the upgrade.php (I've tried with both 4.2.3 and 4.2.4 to upgrade to 4.3) and changing permissions for the main folders to 777, the update script is reporting that it cannot upgrade everything and has skipped the OATH mysql entries, and that it cannot delete files (I've manually deleted the files, added the entries by running the sql directly in phpMyadmin, but am getting a PDO exception like the one when the first version of 4.2 came out. I've even tried installing as the root mysql user but am still getting a blank screen, and have even removed Debian and replaced it with Ubantu 12 just in case Debian was the problem - but still problems.

    Otherwise, the admin interface for 4.3 is very good (well done Sourcefabric!) and the new plugins installer looks excellent - so far the functions I have tested are all working beautifully (apart from not being able to view the front end for a new or upgraded installation, that is...).

    Regards,

    Said
  • 4 Comments sorted by
  • Hi Said R,

    We were facing the same issue a few days ago. Neither setting memory_limit in php.ini didnt help. Then we tried to set it directly for composer processes. First of all we updated composer: php composer.phar selfupdate. 

    Then we set -d memory_limit=1024M in newscoop/library/Newscoop/Services/Plugins/ManagerService.php for all composer processes and it solved the issue (1024M was enough for us, for you could be diffrent limit). Here is the Pull Request with pending fix: https://github.com/sourcefabric/Newscoop/pull/839

    When it comes to permissions. make sure newscoop files are owned by www-data and you will be able to install Newscoop without any permissions issues (you can use sudo -u www-data to perform copying newscoop files etc so you will make sure its owned by proper user). Here you can find upgrade guide (4.2.3/4.2.4 to 4.3): https://github.com/sourcefabric/Newscoop/blob/master/newscoop/UPGRADE_4_3.md#upgrading-newscoop-version-423424-to-43 (but when you upgrade newscoop from branch then you have to install vendors - composer.phar install --no-dev - after step 2.)

    Hope this info will help you!

    Good to hear you like it! Feel free to contribute if you think you can improve Newscoop :)

    Best,
    Post edited by Rafał Muszyński at 2014-10-15 03:54:53
  • Rafal,

    Thank you very much for your reply - I will try your suggestion.

    Regards,

    Said
  • Hi, I tried the fix but was still getting the memory limit error and then tried installing from the command line with the console command give on the Paywall plugin page don github, i.e.

    php -d memory_limit=2000M application/console plugins:install "newscoop/newscoop-paywall-bundle" --env=prod

    This worked (at least it said the plugin was installed and when I looked in the plugins directory all the files were there). HOWEVER, when I then tried to access the front-end or admin page of the site there were only blank screens and nothing in the Apache error log.

    I restored the site and tried again with the same result. Is there a problem with the new plugins manager and 4.3 (I also tried with other plugins and the same problem)?!

    Any help will be appreciated.

    Said
  • Hello, Said.

    I recently ran into the same problem of a blank page after plugin installation.
    Apache Error Log showed something like this: 

    "PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Failed to write cache file[…]"

    And to make it work I had to (I don't know, what does it do, so, please, you better check also with someone else):
    1. I installed ACL, following this article https://help.ubuntu.com/community/FilePermissionsACLs
    2. $ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
    (while in your newscoop root directory): 
    1. $ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX cache log
    2. $ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX cache log
    Hope, I mentioned everything and it might help.

    Post edited by Andrey Pozhalov at 2015-02-22 03:12:02