I'm developing one web application, using PHP eclipse IDE.
For an instance i want to switch from one PHP version to another version which resides in different location.
Below is my working environment :
1) Having Centos OS
2) PHP 5.1.6 have installed already while installing centos OS
3) Above PHP is installed in /usr/bin/ path
4) I have installed LAMPP in /opt/lampp
5) In LAMPP present PHP 5.2.6 version
I want to configure local web server such that lampp should choose PHP 5.1.6 (which resides in /opt/lampp )
I am not aware of this switching of PHP version.
Please suggest me how should i configure this switching of PHP version in my local web server.
Which configuration file should i choose for modifying this change.
Thanks a lot !!!
-Pravin
http://gggeek.altervista.org/2007/07/21/running-multiple-php-versions-on-a-single-apache-install/
This guide is a great guide and will get you started!
Another alternative would be to install Xampp, as I believe they provide a batch file that helps you switch versions of PHP in a second.
Related
I'm running Uwamp server under windows7 and it works perfectly with php versions from 5.5 to 7.0.3 and with curl enabled.
When I switch to php 7.2, 7.3 or latest 7.4.3 uwamp server still working - but without curl.
php_curl.dll file is enabled under extensions (ext) but phpinfo() confirms that curl extension is missing / not enabled. I compared php.ini with previous php versions, modified it but it still doesn't work.
cURL is NOT installed on this server
I have testet xampp and this server has no problem with curl and php 7.3/7.4. I compared php.ini etc. but curl extension still not working under Uwamp.
It seems that the author of the project has abandoned it, because there have been no updates or activities since many years. Maybe someone using it and can help me to solve it.
Any idea would be greatly appreciated!
finally got a working solution for this problem of uwamp and running an up to date version of php and getting curl working.
I have sat here for a couple of days trying to work why you couldn't get a later version of php 7.0.3 without breaking uwamp and curl. So I learnt how to integrate and test php apache as standalones and then working on updating uwamp. Lots of head scratching of working out how uwamp uses its on the fly configuration setup.
I will list all the steps to update your version of uwamp (to apache 4.2 and php 7.4.4 as of Mar 2020)
Download uwamp (portable or installer)
Download c++ runtime https://aka.ms/vs/16/release/VC_redist.x86.exe (taken from the windows php page)
Install the runtime above
Install uwamp to a directory (in this example will just use c:\ making it install to c:\uwamp after expanding)
Before running uwamp
Goto to apache lounge website and download the latest 32 build of apache (4.2)
https://www.apachelounge.com/download/VS16/binaries/httpd-2.4.41-win32-VS16.zip
Expand this archive, it should create a folder called apache2.4
Step in to this directory and copy all the files and paste them here in your uwamp folder (c:\uwamp\bin\apache). This should overwrite all the apache files and add the latest apachephp dll
TIP. Just make sure you havent expanded the apache2.4 zip in the uwamp apache folder, easy to tell as you will see a apache24 appear
Goto to php.net and download the latest THREAD SAFE version of php (7.4.4)
https://windows.php.net/downloads/releases/php-7.4.4-Win32-vc15-x86.zip
Extract the php zip this folder in to the c:\uwamp\bin\php in to a new folder with name of php-7.4.4 (so the files should be in c:\uwamp\bin\php\php-7.4.4)
There you are, you have completed your manual upgrade of uwamp , run uwamp and if no errors appear with in the GUI, everything should be working. Test by opening a browser and use http://localhost/uwamp/phpinfo or http://127.0.0.1/uwamp/phpinfo or click the "phpinfo button" in the uwamp GUI
This way seems to allowed an upgrade of uwamp (except sql) but resolve a common problem of php and curl not working / breaking.
This works for x86 version installed on a 32/64 bit system.
Still trying to work out the kinks for uwamp to be running 64 bit apache and php but should be possible.
Try and delete the version of PHP that is affected by the missing Curl extension and then re-download the version from inside the AWamp interface. I have had similar problems with other extensions and have solved it this way.
I've downloaded XAMPP ver. 7.2.10 which supposedly has the PHP ver. 7.2.10.
But when I run a composer update on cmd, it says that my PHP version is 7.0.21. I need to have a PHP 7.1.3 in order to run my frameworks.
Is there a way to change the PHP version without installing a new XAMPP? Because I already have the latest version installed and the PHP versions stated in the XAMPP and CMD are different.
Change you Xampserver you can't change php version inside xampserver
you can download from below link
Download xampserver
You can also do it in another way.
Download your desired version of php here and then go to XAMPP folder (most likely C:\xampp).
There, extract the downloaded php file and name it php (paste it in C:\xampp) Then, copy all files from your old php folder and paste it in the new php folder.
Do not replace any files, just copy missing files and if your php version is less than 7, don't forget to edit your httpd-xampp.conf file.
Restart your Apache server and, hopefully, it will work.
Maybe you are using another version of php, check if you have another version installed and see environment variables and path there should tell you the php path used, or maybe you have an apache running, to stop it enter services and stop apache24.
Your Bash/Terminal runs in it's own PHP world.
You can upgrade it with apt-get on XAMPP VM
see here:
https://die-schwarzwald-werbeagentur.zazudesign.de/internet-programmierung/a-working-typo3-9-4-x-composer-installation-on-xampp-osx-php7-2-imagemagick-mariadb.html
After upgrading PHP to 7.2 composer will work. For some reason composer uses the bash PHP-version and not the Apache2-PHP-Version
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://.
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.
I was installing the Moodle on my machine and faced a problem of requirement of Greater version of PHP which is not available in present version in wamp.
So couuld anyone suggest me: How can we upgrade PHP in present available wamp installed in Windows ?
You download the addon you want from WampServer addons, and execute it. It will add a context menu entry in WampManager letting you choose between the different installed PHP versions.
Read this article.
Just backup your data
Uninstall WAMP
Install new WAMP
or download this executable and execute it