I installed Laravel 5.0 at my websites (via FTP). Then I tried to connect via SSH and update using Composer. However I am getting this error. (My PHP is version 5.5, I checked the phpinfo function).
PHP Notice: Undefined index: argv in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 55
PHP Warning: array_shift() expects parameter 1 to be array, null given in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 59
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
[ErrorException]
Invalid argument supplied for foreach()
X-Powered-By: PHP/5.3.28
Content-type: text/html
Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI
Notice: Undefined index: argv in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 55
Warning: array_shift() expects parameter 1 to be array, null given in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 59
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
I controlled cli -v , I getting this command not found.
Later I tried below:
$ php -d register_argc_argv=1 "./composer.phar" install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- league/flysystem 1.0.16 requires php >=5.4.0 -> your PHP version (5.3.28) or value of "config.platform.php" in composer.json does not satisfy that requirement.
- league/flysystem 1.0.16 requires php >=5.4.0 -> your PHP version (5.3.28) or value of "config.platform.php" in composer.json does not satisfy that requirement.
- Installation request for league/flysystem 1.0.16 -> satisfiable by league/flysystem[1.0.16].
I suspect this is the important error:
Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI
Try which php to see where your PHP binary is pointing, and then locate bin/php to find out what other versions you have your system.
Also note this:
My PHP is version 5.5; I checked the phpinfo function
Something disagrees with you:
X-Powered-By: PHP/5.3.28
Try other copies of your PHP binary, discovered with locate, using the fully-qualified path. For example:
/usr/bin/php55-cli composer.php update
If this host has a 5.5 CGI binary and a 5.3 console binary, it is possible they do not know what they are doing - 5.3 should no longer be supported these days. If you do not have any luck fixing it yourself, create a support ticket and ask for php to invoke the 5.5 console binary from the shell.
Update: following from the conversation in the comments, it looks like the above has fixed one problem and exposed another. The new problem is that your Composer command is getting further, and it is trying to invoke a PHP helper that uses the php binary again. This then causes the original problem (it's the web server binary, and it's 5.3 rather than 5.5).
To resolve this, I suggest you (a) create a local php executable to point to the version you want, and then (b) reset the system path. I would try the following, in your project directory:
ln -s /usr/bin/php55-cli ./php
PATH=. ./php composer.phar update
What this will do is create a symbolic link to the version of PHP that you want, and then reset the system path temporarily to just the current directory.
If this does not fully resolve the issue, you may need to put your symlink in a more permanent place (e.g. ~/bin/php and modify your shell start-up file. Please be willing to play around with this before exclaiming that it does not work - the best way to learn how to do this independently is to try!
Related
I am working with prestashop 1.7
i deleleted the cache folder but i restored it, and i have the same problem
Fatal error: Uncaught Error: Class 'Cache' not found in \prestashop\classes\ObjectModel.php on line 2000
idon't have the "class_index.php" file in cache folder. I don't have Cache.php in classes folder
any suggestion please
Probably you are missing some core file,
yhe same thing happened to me in the past, when transferring with rsync the site from one server to another I excluded "cache" thinking to bypass the only cache folder, but I also excluded some core files :)
Check for the existance of the /classes/cache folder,
it should contain "Cache.php" and some other Cache related classes aswell.
If they are missing, restore them from a backup or from the official Prestashop archive of the same version.
i have these warning
Warning: simplexml_load_file(): I/O warning : failed to load external entity "" in /home/vrqlcrq/www/src/Core/Localization/CLDR/Reader.php on line 152
Warning: simplexml_load_file(): I/O warning : failed to load external entity "" in /home/vrqlcrq/www/src/Core/Localization/CLDR/Reader.php on line 162
Notice: Trying to get property 'parentLocales' of non-object in /home/vrqlcrq/www/src/Core/Localization/CLDR/Reader.php on line 212
Notice: Trying to get property 'parentLocale' of non-object in /home/vrqlcrq/www/src/Core/Localization/CLDR/Reader.php on line 212
Warning: Invalid argument supplied for foreach() in /home/vrqlcrq/www/src/Core/Localization/CLDR/Reader.php on line 212
Notice: Trying to get property 'parentLocales' of non-object in /home/vrqlcrq/www/src/Core/Localization/CLDR/Reader.php on line 212
Notice: Trying to get property 'parentLocale' of non-object in /home/vrqlcrq/www/src/Core/Localization/CLDR/Reader.php on line 212
Warning: Invalid argument supplied for foreach() in /home/vrqlcrq/www/src/Core/Localization/CLDR/Reader.php on line 212
I'm trying to get the Trader PECL extension running on my Mac Sierra/PHP 7.1 but to no avail.
I used:
sudo pecl install trader
and got (tail end of my results):
Build process completed successfully
Installing '/Applications/AMPPS/php-7.1/lib/extensions/no-debug-non-zts-20160303/trader.so'
Warning: Invalid argument supplied for foreach() in Validator.php on line 870
Warning: Invalid argument supplied for foreach() in /usr/local/pear/share/pear/PEAR/PackageFile/v2/Validator.php on line 870
Warning: Invalid argument supplied for foreach() in v2.php on line 1664
Warning: Invalid argument supplied for foreach() in /usr/local/pear/share/pear/PEAR/PackageFile/v2.php on line 1664
Warning: Invalid argument supplied for foreach() in v2.php on line 1664
Warning: Invalid argument supplied for foreach() in /usr/local/pear/share/pear/PEAR/PackageFile/v2.php on line 1664
install ok: channel://pecl.php.net/trader-0.4.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=trader.so" to php.ini
I then added:
extension=/Applications/AMPPS/php-7.1/lib/extensions/no-debug-non-zts-20160303
/trader.so
and restarted Apache. After typing php -m, I get:
PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/AMPPS/php-7.1/lib/extensions/no-debug-non-zts-20160303/trader.so' - dlopen(/Applications/AMPPS/php-7.1/lib/extensions/no-debug-non-zts-20160303/trader.so, 9): no suitable image found. Did find:
/Applications/AMPPS/php-7.1/lib/extensions/no-debug-non-zts-20160303/trader.so: mach-o, but wrong architecture
/Applications/AMPPS/php-7.1/lib/extensions/no-debug-non-zts-20160303/trader.so: mach-o, but wrong architecture in Unknown on line 0
OK; so my error is tell me that I'm using the wrong architecture. How can I change the architecture so that the extension works?
UPDATE: As recommended, I tried to compile by source and now am getting the error:
/Users/me/downloads/trader-0.2.2/trader-0.2.2/functions/trader_acos.c:61:2: error: too many arguments provided to
function-like macro invocation
TRADER_DBL_ZARR_TO_ARR(zinReal, inReal)
^
./php_trader.h:243:37: note: expanded from macro 'TRADER_DBL_ZARR_TO_ARR'
zend_hash_get_current_data(ht, (void **)&data) == SUCCESS; \
^
/Applications/AMPPS/php-7.1/include/php/Zend/zend_hash.h:214:9: note: macro 'zend_hash_get_current_data' defined here
#define zend_hash_get_current_data(ht) \
^
/Users/me/downloads/trader-0.2.2/trader-0.2.2/functions/trader_acos.c:61:2: error: use of undeclared identifier
'zend_hash_get_current_data'; did you mean 'zend_hash_get_current_data_ex'?
TRADER_DBL_ZARR_TO_ARR(zinReal, inReal)
^
./php_trader.h:243:6: note: expanded from macro 'TRADER_DBL_ZARR_TO_ARR'
zend_hash_get_current_data(ht, (void **)&data) == SUCCESS; \
^
/Applications/AMPPS/php-7.1/include/php/Zend/zend_hash.h:198:30: note: 'zend_hash_get_current_data_ex' declared here
ZEND_API zval* ZEND_FASTCALL zend_hash_get_current_data_ex(HashTable *ht, HashPosition *pos);
^
/Users/me/downloads/trader-0.2.2/trader-0.2.2/functions/trader_acos.c:61:2: warning: implicit declaration of function
'Z_DVAL_PP' is invalid in C99 [-Wimplicit-function-declaration]
TRADER_DBL_ZARR_TO_ARR(zinReal, inReal)
^
./php_trader.h:246:14: note: expanded from macro 'TRADER_DBL_ZARR_TO_ARR'
arr[i] = Z_DVAL_PP(data); \
^
1 warning and 2 errors generated.
make: *** [functions/trader_acos.lo] Error 1
I'm able to SSH into my web host(Bluehost) just fine. In my root folder(public_html) I installed composer with the following command..
curl -sS https://getcomposer.org/installer | php
When I run "php composer.phar" I get an error that pops up in the command line.
[ErrorException]
Invalid argument supplied for foreach()
I notice in my root folder where I installed composer I keep getting a file called error.log that includes the following...
PHP Notice: Undefined variable: argv in - on line 13
PHP Notice: Undefined index: argv in phar:///home2/websitename/public_html/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 55
PHP Warning: array_shift() expects parameter 1 to be array, null given in phar:///home2/websitename/public_html/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 59
PHP Warning: Invalid argument supplied for foreach() in phar:///home2/websitename/public_html/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
Not sure what to do next. My end goal is to install Laravel. Any assistance would be appreciated.
I am experiencing problems with IMAP resources in PHP: I the error supplied is not a valid imap resource for the following code:
$imap = imap_open("{"."$host:$port/imap$ssl"."}$folder", $user, $pass);
imap_headers($imap);
$new_emails = imap_search($imap, "UNSEEN");
imap_close($imap);
$counter = $counter+count($new_emails);
I get the following errors:
warning: imap_close(): supplied is not a valid imap resource on line 896.
warning: imap_headers(): supplied is not a valid imap resource on line 892.
warning: imap_search(): supplied is not a valid imap resource on line 894.
Edit
I'm now also getting:
NO IMAP CONNECTION Notice: Undefined variable: imap_connection in /var/www/vhosts/talent.co.uk/httpdocs/intranet/model/helpdesk_finance_admin.php on line 214
Warning: imap_getmailboxes(): supplied argument is not a valid imap resource in /var/www/vhosts/talent.co.uk/httpdocs/intranet/model/helpdesk_finance_admin.php on line 216
Notice: Undefined variable: imap_connection in /var/www/vhosts/talent.co.uk/httpdocs/intranet/model/helpdesk_finance_admin.php on line 220
Warning: imap_headers(): supplied argument is not a valid imap resource in /var/www/vhosts/talent.co.uk/httpdocs/intranet/model/helpdesk_finance_admin.php on line 220
Notice: Undefined variable: imap_connection in /var/www/vhosts/talent.co.uk/httpdocs/intranet/model/helpdesk_finance_admin.php on line 222
Connection failed! Notice: Undefined property: model::$no_mail in /var/www/vhosts/talent.co.uk/httpdocs/intranet/view/helpdesk_finance_admin.php on line 1346
Warning: Invalid argument supplied for foreach() in /var/www/vhosts/talent.co.uk/httpdocs/intranet/view/helpdesk_finance_admin.php on line 1403
Most likely there is an error and imap_open returns FALSE which is not a valid resource to be passed to imap_close.
Always check the results of operations that can fail
The Login details were wrong, so imap couldn't connect succcesfully and that therefore lead to an error code.
try with this syntaxe
{webmail.talent.co.uk:993/imap/ssl/novalidate-cert}INBOX
I've installed restler using composer. I've set up a virtual host for it. I'm able to go to my localhost in my browser and it shows some informational pages but as soon as I try one of the APIs I get a server 500 error.
My PHP logs say:
Function main
Error Type E_ERROR
Source File /public/examples/_001_helloworld/index.php : 18
Error String Class 'Luracast\Restler\Restler' not found
I'm using the example code straight out of the project. It looks like it has the require_once '../../../vendor/restler.php' and it seems to still have 500 errors.
I'm using PHP 5.4.16 on a Mac.
Update
Here are all of my logs:
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(/Users/ChrisLondon/composer/autoload_classmap.php): failed to open stream: No such file or directory in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(): Failed opening '/Users/ChrisLondon/composer/autoload_classmap.php' for inclusion (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear:/opt/local/lib/php') in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(/Users/ChrisLondon/composer/autoload_namespaces.php): failed to open stream: No such file or directory in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(): Failed opening '/Users/ChrisLondon/composer/autoload_namespaces.php' for inclusion (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear:/opt/local/lib/php') in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_values() expects parameter 1 to be array, boolean given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 154
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_merge(): Argument #2 is not an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 155
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_merge(): Argument #1 is not an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 155
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_map(): Argument #2 should be an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 166
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_filter() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 166
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: natsort() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 167
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_unique() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 170
[05-Sep-2013 17:05:09 America/Denver] PHP Warning: implode(): Invalid arguments passed in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 170
[05-Sep-2013 17:05:09 America/Denver] PHP Fatal error: Class 'Luracast\Restler\Restler' not found in /Users/ChrisLondon/personal/SuperfyMe/public/examples/_001_helloworld/index.php on line 19
It seems like it's trying to find the autoload class here: /Users/ChrisLondon/composer/autoload_classmap.php but the file is actually here: /Users/ChrisLondon/personal/SuperfyMe/vendor/composer/autoload_classmap.php
Solved my issue.
It turns out because I have a folder named composer/ that happens to be two folders up from where the Restler app sits it ruins the Restler autoloader. To solve the issue one needs to do one of the following:
1) Don't have any folder named composer/ two folders up from where the Restler app resides
2) Modify the Restler autoloader to skip the folder (at the time of this post you could comment out line 138 of /vendor/Luracast/Restler/Autoloader.php)
A more elegant solution has been proposed by me on GitHub:
Issue: https://github.com/Luracast/Restler/issues/195
Pull Request: https://github.com/Luracast/Restler/pull/196
By the time someone else finds this post hopefully the issue will be resolved in future versions of Restler.