I have uninstalled XAMPP because recently I found that php comes install by default in macOS. My MacOs version is Catalina. So whenever I fire any php command from cli it gives me Library not loaded but strange thing is it returns XAMP path.
Related
MacOS 12.1 After successfully installing php 8.1 with homebrew (along with apache/mySQL and phpmyadmin) I am trying unsuccessfully to install/link php 7.4. After following instructions to install, unlink, link, php -v returns 7.4 but phpinfo() shows 8.1. What am I doing wrong?
Strange enough, using a full name such as "shivammathur/php/php#8.1" for the link command is what worked for me.
Eg:
brew link --overwrite --force shivammathur/php/php#7.4
Also, don't forget to close your terminal completely and reopen it before checking the version with php -v.
It looks as if I never successfully killed the included MacOS Apache. I uninstalled home-brew and the server was still running (with PHP8.1!). Not sure what went wrong.
I have php5 installed on my macbook then I tried to update it, to php7 after I successfully installed the php7, I tried to check the installed version using php -v. But to my surprise it shows I still have php5 running on my system. After that I tried to move my php7 to my php5 directory /bin/usr/ but failed. Then I tried to run php-v but the response I got was -bash: command not found. Please how can I solve this both on my terminal and VSCode?
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?
I have installed both PHP versions (php5 & php7) on the same Linux server and it works for me, when I switch the version configuration on system.
Also it shows changes happen in the info.php file in the browser, but in terminal using php -v ,it shows only php7 version installed though it works under php5.
how can i correct the version information in php5 while chk in terminal?
When PHP is installed side to side there are different executables for the different versions. When you use a Web Server you choose which version to use via its configuration.
If php -v shows PHP 7 try php5 -v. If this returns the right version you can use php5 to run any script with php5.
To find out where exactly the PHP executables are use:
which php
whereis php
which php7
whereis php7
Recently I installed XAMPP for doing local development on my Windows 7 machine. I honestly didn't think PHP was installed at all before hand. I installed the latest version of XAMPP and configured for php 5.6.24. I created some virtual hosts and everything seemed to work.
I was having an issue and I needed to confirm which version of PHP I was using so I opened up my command line and typed php -v. For some reason it is reporting I'm using PHP 5.4.25. The exact line is PHP 5.4.25 (cli) (built: Feb 5 2014 21:19:58)
I don't recall using this version (I had Visual Studio Community installed recently, is that related?). I don't understand either why my CLI is reporting one version, when XAMPP supposedly installed another version. Am I missing something? I need to run some gpm commands for the latest version of Grav CMS but when I do it says it required at least 5.5.9.
It is possible to have multiple versions of php installed.
You will want to ensure that you are executing the php-cli that came with XAMPP.
It sounds like you have another version of php installed and is in your PATH so that when you run php that version is loaded.
You can use the where command to find out what file is being loaded.
From the terminal type: where php
I am not a windows guy but there is a which command on linux. Apparently this is the command for windows. Here is a SO post about it:
Is there an equivalent of 'which' on the Windows command line?
Anyways, you may want to remove that php file and possibly create a symbolic link in its place for the XAMPP version of php-cli
If you remove/rename the file and the new php-cli is not in your path, you will probably get an error as the system will not know what php is.
The solution to this is to uninstall all the xampp's that are installed and then fresh install xampp with php version > 7.
Everything should work fine then.
What happened to me was that I had installed xampp two times. One
xampp on my C:// (version 5.6) and one xampp on my D:// (version 7.2)
When I did the command on my D:// xampp
php --version
It took the xampp php version from the C:// instead of the D://.