Closed mxmkmarquette closed 5 years ago
Hi @mxmkmarquette
This reads like an error trying to run PHP7+ code in a PHP5.* environment. Are you still on PHP5?
hi im on php7 but to be sure i have run it like that
/opt/plesk/php/7.2/bin/php /usr/lib64/plesk-9.0/composer.phar install so habitually it setting the php version from the directoy ask no?
Function imports have been added in PHP5.6+ and the code looks fine. I'm a bit lost now. While your command looks right on the surface, the error is caused by a PHP interpreter encountering unsupported language features (-> php 5.5 or lower).
Can you post the composer.json of your project root?
And just to make sure: /opt/plesk/php/7.2/bin/php -v
does report the right version?
-sh-4.2$ /opt/plesk/php/7.2/bin/php -v PHP 7.2.15 (cli) (built: Feb 8 2019 10:07:12) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.1, Copyright (c) 2002-2018, by ionCube Ltd. with Zend OPcache v7.2.15, Copyright (c) 1999-2018, by Zend Technologies -sh-4.2$
"name": "inpsyde/wp-stash", "description": "Powerful Object Caching Backend for WordPress", "license": "GPL-2.0+", "type": "wordpress-muplugin", "authors": [ { "name": "Biont", "email": "m.meisselbach@inpsyde.com" }, { "name": "ChriCo", "email": "c.brueckner@inpsyde.com", "homepage": "https://www.chrico.info" } ], "support": { "src": "https://github.com/inpsyde/WP-Stash", "issues": "https://github.com/inpsyde/WP-Stash/issues" }, "require": { "php": ">=7.0", "tedivm/stash": "^0.15", "psr/log": "~1.0" }, "require-dev": { "phpunit/phpunit": "~7", "brain/monkey": "^2", "inpsyde/php-coding-standards": "^0.12", "squizlabs/php_codesniffer": "~3.2.3" }, "autoload": { "psr-4": { "Inpsyde\\WpStash\\": "src/" } }, "autoload-dev": { "psr-4": { "Inpsyde\\WpStash\\Tests\\Unit\\": "tests/PHPUnit/Unit/" } } }
Okay so I understand you are not pulling WP Stash as part of a larger project, but rather as a standalone package? Can you post the exact command you're using to install?
Can you try to composer install --no-dev
instead? Whatever problem there is, it comes from pulling a dependency of PHPUnit, which is not needed for production use
` [Symfony\Component\Process\Exception\ProcessFailedException] The command "'/var/www/vhosts/mad-max.ca/httpdocs/wp-content/mu-plugins/WP- Stash/vendor/bin/phpcs' '--config-show' 'installed_paths'" failed.
Exit Code: 255(Unknown error)
Working directory: /var/www/vhosts/mad-max.ca/httpdocs/wp-content/mu-plugin s/WP-Stash
PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecti ng identifier (T_STRING) or \ (T_NS_SEPARATOR) in /var/www/vhosts/mad-max. ca/httpdocs/wp-content/mu-plugins/WP-Stash/vendor/myclabs/deep-copy/src/Dee pCopy/deep_copy.php on line 5
`
same problem my friend and yes as standalone package
So you cloned our repo with git clone git@github.com:inpsyde/WP-Stash.git
and then ran composer install --no-dev
inside the WP-Stash
folder, right?
It should not be pulling myclabs/deep-copy
and it doesn't. I have just tried.
working now but have a blank /wp-admin
Fatal error: Uncaught Error: Class 'Inpsyde\WpStash\WpStash' not found in /var/www/vhosts/mad-max.ca/httpdocs/wp-content/object-cache.php:155 Stack trace: #0 /var/www/vhosts/mad-max.ca/httpdocs/wp-includes/load.php(521): wp_cache_init() #1 /var/www/vhosts/mad-max.ca/httpdocs/wp-settings.php(113): wp_start_object_cache() #2 /var/www/vhosts/mad-max.ca/httpdocs/wp-config.php(94): require_once('/var/www/vhosts...') #3 /var/www/vhosts/mad-max.ca/httpdocs/wp-load.php(37): require_once('/var/www/vhosts...') #4 /var/www/vhosts/mad-max.ca/httpdocs/wp-admin/admin.php(31): require_once('/var/www/vhosts...') #5 /var/www/vhosts/mad-max.ca/httpdocs/wp-admin/index.php(10): require_once('/var/www/vhosts...') #6 {main} thrown in /var/www/vhosts/mad-max.ca/httpdocs/wp-content/object-cache.php on line 155
Can you rename the muplugin folder from WP-Stash
to wp-stash
and tell me if that fixes it please?
(note to self: if yes, we need to come up with a better way to deal with differing install folder names here)
all working
`[Symfony\Component\Process\Exception\ProcessFailedException] The command "'/var/www/vhosts/mad-max.ca/httpdocs/wp-content/mu-plugins/WP- Stash/vendor/bin/phpcs' '--config-set' 'installed_paths' '../../automattic/ phpcs-neutron-standard/,../../inpsyde/php-coding-standards/,../../wimg/php- compatibility/,../../wp-coding-standards/wpcs/'" failed.
Exit Code: 255(Unknown error)
Working directory: /var/www/vhosts/mad-max.ca/httpdocs/wp-content/mu-plugin s/WP-Stash
Output:
Error Output:
PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecti ng identifier (T_STRING) or \ (T_NS_SEPARATOR) in /var/www/vhosts/mad-max. ca/httpdocs/wp-content/mu-plugins/WP-Stash/vendor/myclabs/deep-copy/src/Dee pCopy/deep_copy.php on line 5 `
i got this error when doing composer install for dependencie