cakephp 3 installation error with composer - php

I have Php 7 installed but whenever I try to install CakePHP from the command line using composer I get this error:
Your version of PHP, 5.4.0beta2-dev, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.
my PHP version is up to date and I can't install CakePHP locally as it will provide many errors

Just read that error message again. It's more than clear:
Your version of PHP, 5.4.0beta2-dev, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.
You obviously don't run php 7 in your CLI environment.
https://unix.stackexchange.com/questions/163762/php-cli-and-bash-change-behaviour-of-php-keyword
Use different PHP version CLI executable for one command
How to access PHP with the Command Line on Windows?
Let me google that for you

Related

showing two different PHP versions in command line

I installed laravel project 5.1 which is working fine but artisan commands are not working throwing each() error which is deprecated in php 7.1. When I run phpinfo() it shows php version 5.6 and on command line there's also two versions are showing
when run
phpinfo();
5.6
when run on command Line in xampp folder
C:/xampp> php -v;
5.7
when run in command in this xammpp/php directory
C:/xampp/php> php -v;
5.6
This is because there are CLI version and WEB version.
How Giacomo1968 says in this answer on Super User:
“Don’t panic! If you are concerned about what PHP version your Apache server is using, the output of phpinfo() is always what you should pay attention to. The Apache PHP module and the PHP command line binary are two different things that don’t interfere with each other.
In fact you can compile and load various PHP versions you want to work with Apache as long as you adjust Apache to properly load it. The PHP command line interface will never come into play in the case of Apache parsing PHP pages.
The command line version of PHP is simply there for command line specific tasks and the PHP module for Apache will never touch, use or need that.”

Unable to install phalcon 2.x on VPS from 1and1 hosting

I ran into a troublesome issue.
I'm using 1 and 1 virtual private server redhat linux. The server's default PHP version is PHP 5.3.
I do have installed PHP 5.5 on the server. I switch to PHP 5.5 using alias php='path to php'.
I run command php -v to see if the version has changed, indeed it has - the PHP version is now 5.5.
However I am still unable to install phalcon, when I run the command ./install -i I get this error message:
Php 5.3 is not supported.
Any ideas how to resolve this problem?
Alias will not work in your case because it changes php path only for your terminal, not globally.
I'm not a redhat user so can't give you exact steps but a kinda dirty solution is to find your php binary (on debian is in /usr/bin/, /bin/ or /usr/local/bin), rename it to for example php5.3 and in this place make a symbolic link to new php.
Remember that your php webserver (apache, nginx or whatever you use) should also have an updated php! What is more, to compile phalcon you'll need also an updated phpize and other dependencies. I'm not a linux expert so cannot tell you exactly which parts of php5-dev did changed between PHP 5.3 and 5.5 and which did not.
Alternatively you can just clone from github and install an old phalcon 2.x which is also great. The new 3.0 doesn't have that much breaking features. It's killing feature is PHP7 which it seems that you're not going to use. Phalcon 2.x requires PHP5.4+
I belive there are better ways how a php update should be performed but I don't know them.

Is there a difference when running Composer in different versions of PHP?

I have a Vagrant machine with the actual PHP version I want my server to run on, but locally I use a newer version of PHP.
Updating Composer locally just saves so much time as opposed to updating it on the virtual machine via SSH.
So my question is: Does it affect the vendor files when composer install or update is called from different versions of PHP?
The PHP version used when updating the dependencies affects the packages being used. Packages can define a requirement on a certain PHP version.
A common requirement found is requiring PHP 5.4 or 5.5 when a package is using the features of said versions, or PHP 5.3.3 or PHP 5.3.27 because the package needs certain bugfixes.
Composer will complain about not being able to execute composer install if the PHP version used when running this command is not able to fulfill all PHP version requirements that are mentioned in the lock file.
Running composer update with an older PHP version than composer install probably will work in most cases. Using the same PHP version should be the recommended setting, though.
Also: Using the same required extensions in all PHP versions also is needed for requirements checking.
Note that there is some demand for Composer to assume a given PHP version or extension is present on the target platform even if the command line PHP running the Composer command does not fulfill them, but this feature is not implemented yet. So there is no way to override the local PHP version with the one present on the target environment.

how to use MongoDB in laravel4?

I have successfully installed Mongodb on my win 7 system. I also installed php extension for MongoDB on my Wamp server and it works perfectly; yet I wish to know how I can use MongoDB in my laravel4 projects. I will like to use mongovel package but when I run 'composer update' there is always an error: php extension not found in your system. Also I installed jessengers package but got an error: MongoClient not available. Please I need help on how to get out of this. Thanks
You need to make sure that the extension is also available on the command line. In many cases there is a different php.ini for CLI. You can find this out by running:
php --ri mongo
if that does not provide any sort of output about version and settings, you don't have it installed properly.
Then you can use php --ini to find out where your INI files are - the ones that are used for running PHP on the command line

How do I solve this PHP-PEAR error / install PEAR on Fedora?

I'm trying to save an old, failing web-server setup consisting of Fedora, PHP, PEAR, and Oracle.
With some difficulty (I'm very new to all four), I've been able to set up something similar on a newer system. I used Fedora 19, PHP 5.5.4 (with Apache 2.4.6), and Oracle 11g.
That just leaves PEAR.
Now, from what I understand, PEAR is some PHP code, like a library, which PHP Web Applications can use to save time from having to code them again - database connection, for example.
But I don't know what to do with it, or even how to get it. Copy paste from my old system? Download using the CLI using yum? Are there packages I need to be aware of, or is it just a one download-one install thing?
For instance, a basic PHP webpage with the following code:
<?php
phpinfo();
?>
works fine on the new server setup, so I'm assured that everything else is working. But when I try to load the PHP files from the other server, it returns an Internal Server Error. I checked the error_log files under /etc/httpd/logs, and most of the errors appear as below:
PHP Fatal error: require_once(): Failed opening required 'MDB2.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/hrweb/includes/functions.php on line 4
EDIT:
According to the PEAR Website, PEAR is included upon the installation of PHP, though not all modules / packages are there. Typing in the command pear in the CLI does confirm it is installed, though it does not help the issue.
I got the MDB2 package via pear install MDB2, though apparently, MDB2_Driver_oci8 is required. Whenever I try to download that, I get the following:
"MDB2_Driver_oci8" version "1.4.1" does not have REST XML available
In addition to this, I also tried to download OLE, which gets me the following:
No releases available for package "pear.php.net/OLE"
This was also previously the error of trying to download MDB2_Driver_oci8.
Thanks.
You have to install the (surprise!) MDB2 package to get MDB2.php:
$ pear install mdb2
and the adapter of your choice:
$ pear install mdb2_driver_mysql-beta
Then make sure the PEAR php directory is in your include path - see the PEAR manual.
"MDB2_Driver_oci8" version "1.4.1" does not have REST XML available
try to install the beta version:
$ pear install mdb2_driver_oci8-beta
No releases available for package "pear.php.net/OLE"
You're trying to install the stable version, but OLE does not have any stable version (yet): http://pear.php.net/package/OLE/download
Append either -alpha or -beta after OLE:
$ pear install OLE-beta

Categories