Error while trying command: php yii migrate in terminal - php

I had errors while trying the command:
php yii migrate
A PDO driver error or other errors shown

After trying many solutions I got the answer:
1)I just uninstalled xampp on my computer from control panel
2)Downloaded and Installed xampp version 7.4.6
3)Downloaded and intalled composer pointing the required php.exe to C:\xampp\php\php.exe which was my xampp installation folder
4)Finally re run php yii migrate and it is successful

Related

I'm getting the error on Cpanel that I'm running php 7.4 yet when I run php -v I get 8.02

I've deployed a laravel app on cpanel. The app is working as expected on my local machine but on cpanel I'm getting the error below.
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.30. in /home4/peakcoke/public_html/vendor/composer/platform_check.php on line 24
When I run php -v I get 8.0.20.
How can I fix this?
Do a phpinfo(), what you get by running php -v from terminal is PHP CLI version.
Also, Cpanel usually comes with PHP Selector component that allows you to switch between different installed versions.

php --version Alias setting goes wrong on Mac

I am developing a PHP project. I am using Mac OS X now. To be honest, this is the first time developing a PHP project using Mac. I am a Windows. I installed PHP using Brew by running the following command.
brew install php
It gave me the php latest version, 7+. For my project, I need to use php version 5.6. So, I installed another PHP by running this command.
brew install php56
Up until this point when I enter "php --version" in the terminal, it is showing that I am using php version 7+. I found some solution to change php version and so I used one of them and run this command.
alias php='/usr/local/etc/php/5.6/php'
After running that command, when I type in "php --version" in the terminal, it is showing this error.
-bash: /usr/local/etc/php/5.6/php: No such file or directory
Now, I cannot use any PHP on my Mac right now. How can I fix that?

laravel installation error with composer

I have faced the following problem during the installation of laravel php framework.
following errors appeared when I run the command composer global require "laravel/ installer".
NB: I already have installed xampp, composer and add these to environment variable.
the following picture will clear the problem. enter image description here
I have used php version 5.6 and tried to install laravel having this version.
Later I have uninstalled xampp and install the latest version of xampp and things are working now

Installing laravel using Zend Server 8.0.1 PHP 5.6.4 CLI stopped working

I have Installed Zend Server 8.0.1 with PHP 5.6.4 on Windows 8.1. I have added 'E:\Program Files (x86)\Zend\ZendServer\bin' to PATH variable, which contains PHP binaries.
I have Installed Composer Globally. I am trying to create a Laravel project using composer command 'composer create-project laravel/laravel'. After a while PHP CLI stops working. Screen shot is below.
screen shot of PHP settings given below.
I tried it few times but same error. Has anybody faced same problem. Unfortunately I don't have tool to analyze Dump.
It is a bug with Zend Server 8.x, PHP 5.6 and composer running on Windows that Zend is aware of (see http://forums.zend.com/viewtopic.php?f=8&p=245953).
Using older version of composer.phar works for me. Get the composer.phar from the Zend Skeleton Application (https://github.com/zendframework/ZendSkeletonApplication) and try with it.

Error installing Laravel 4 with composer

When I try to install Laravel 4 via Composer, I get the following message in Terminal
Mcrypt PHP extension required. Script php artisan optimize handling
the post-install-cmd event returned with an error
The PHP version on my computer is 5.5.3 and when I run phpinfo it shows that mcrypt is enabled. When I run the which php command in Terminal it shows
/usr/bin/php
I therefore extended the $PATH with .bash_profile.
export PATH=/Applications/MAMP/bin/php/php5.5.3/bin:$PATH
Unfortunately, the which php command still shows /usr/bin/php after extending $PATH. And as a result the error is still there.
So I am out of ideas on how to solve this issue. Does anyone have an idea? Thanks!
There is difference between the MAMP PHP version and you "Terminal" PHP version. Therefore are you probably setting up the export path.
When you are changing the export path you have to restart your terminal before it will take effect on your computer.
I am not sure of this but when your error is appearing and older version of Laravel will be installed.
What do you get when you execute: php -v in your terminal?

Categories