How to change PHP version in XAMPP? - php

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

Related

How to enable curl in php 7.3+ in uwamp server

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.

It is possible to use different PHP versions in lampp [duplicate]

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.

Lampp PHP doesn't work like environment in PHP

I'm using LAMPP (XAMPP on Linux) to operate my server.
LAMPP has its own php binaries /opt/lampp/bin/php, which is different from the php version I have in /usr/bin/php. That is, when I've installed extensions using the command line, they've been successfully added to the original /usr/bin/php, but the php version which is associated with Lampp didn't recognized these extensions.
The question is, how to get these extensions into work with Lampp?
I can change my original php to the one in Lampp (so I can normally install extensions) or I can change the PHP associated with Lampp to be the original one but I don't know the way to do this.

Upgrading PHP 5.4.0 in XAMPP for Windows?

I want to upgrade to PHP 5.4.0 in XAMPP. I'm using windows operating system. I searched on web, but there was no proper guide for this as it was released recently.
Can anyone give me some instructions on how to upgrade to PHP 5.4.0 in XAMPP (windows)?
Download the latest binary version of PHP (make sure to get the .zip package not the installer)
De-archive it to a directory
Copy the contents of the directory in the php subfolder of your XAMPP installation directory, overwriting the files which are already present
Overwrite the files which are already present in the apache\bin directory with the newer versions.
Now the trick: take the files which have a "_2" in their names (for example php5apache2_2.dll or php5apache2_2_filter.dll), copy them in the apache\bin subdirectory and remove the "_2" part, overwriting the existing files. This is necessary because by XAMPP uses Apache version 2.2 and the files with the 2 prefix are built for Apache 2.0, so you must take the files build for the newer version (which has a different plugin interface) and rename them in the filenames XAMPP expects.
Source
I found a working php_uploadprogress.dll extension for xampp windows with php 5.4 here:
http://www.fsbcomputers.com/php_uploadprogress
there are 32 and 64 bit versions as well as a preview for php 5.5.
By the way, the php build numbers, apache /xampp refers to are:
PHP 5.2: 20060613
PHP 5.3: 20090626
PHP 5.4: 20100525
I hope that you are still following this, I installed php 5.4 on the latest xampp stable with no problem.
Fortunately for you, there is a beta update of xampp which makes life easier. http://www.apachefriends.org/en/xampp-beta.html
Just make sure to make a complete backup of your old xampp directory, and export your old databases so you can import them into your new (updated) mysql installation. Alternatively you do not need to update mysql, I use this beta and I can say that it's pretty solid.
EDIT: The pop-up warning were a problem that I had too, I recommend using the latest beta. But, you can fix the errors and use php 5.4 on your old install (not recommended) by commenting out the following line in php.ini
extension=php_oci8.dll
Change to
;extension=php_oci8.dll
I have done the upgrade in ubuntu. Following are the steps to do the upgrade.
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5
sudo /etc/init.d/apache2 restart

program cant start because php5.dll is missing

I installed XAMPP , phpinfo: PHP Version 5.3.5
Downloaded PHPPDT, installed
downloaded webserver debug extension, copied dummy.php
added zend_extension="c:\edward\xampp\php\ext\5_3_x_nts_comp\ZendDebugger.dll"
stop, restart apache, get:
"the program cant start because php5.dll is missing from your computer"
(while php5nts.dll is included)
is installing zend studio ce the alternative or can i make it work with XAMPP? (using Zend Studio CE works)
if your php version is Non-Thread-Safe (nts)
you must use php extension with format example: extension=php_cl_dbg_5_2_nts.dll
else if your php version is Thread-Safe (ts)
you must use php extension with format example: extension=php_cl_dbg_5_2_ts.dll
(notice bolded words)
So if get error like above. Firstly, check your PHP version is nts or ts, if is nts.
Then check in php.ini whether has any line like zend_extension_ts="C:\xammp\php\ext\php_dbg.dll-5.2.x" choose right version of php_dbg.dll-5.2.x from it homepage (google for it).
Change from zend_extension_ts to zend_extension_nts.
Hope this help.
Download php5.dll (http://windows.php.net/download/) and copy it to apache/bin folder. That solved it for me (Win 7 64 bit apache 32 bit)
EDIT:
Start with the non-thread safe version.
For Wamp x86+Phalcon users (with same error):
Take care of download the right version of Phalcon:
Phalcon 1.3.2 - Windows x86 for PHP 5.5.0 (VC11)
I had the same problem I switched from wamp to xampp and yes PHP was working because my path was still pointing to my old installation. I had forgotten to change it to point to my new php installation which version of php didn't match the rest at all.
In case this might help someone, after installing the thread safe version of PHP 5.5.1, everything was working under apache for my dev sites, but I ran into the same "php5.dll is missing" problem installing Composer using the Composer-Setup.exe - or, as I soon discovered, just running something as simple as php -v from the command line. I made a copy of php5ts.dll and named it php5.dll and everything worked. I assume the Composer installer was specifically looking for "php5.dll" and I knew that the thread safe code would be run by the renamed .dll. I also assume something is wrong with my setup to screw up the command line functionality, but with everything working, I have more important issues to deal with than to try and find the problem.
I just now faced this issue while trying to restart XAMPP Apache.
What you can do to solve this is:
download PHP5.dll from http://originaldll.com/file/php5.dll/30704.html
Copy the downloaded php5.dll to C:\xampp\php
Start APACHE and MySql from XAMPP control panel
Hope my solution solves your problem.
Thank You!
I needed to change environment variable PATH and PHPRC. Also open new cmd.
I already had PHP installed and added EasyPHP when the problem came up. After I changed both variables to C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\binaries\php\php_runningversion it worked fine.
When you open phpinfo()
see if the thread safety is enable or not enable
also see the version of php
and see MSVC-- what is the number in place of --
and see the architecture
these all things help u to get the suitable php driver
here a url help u to get a php driver
https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
What you can do to solve this is:
Download PHP5.dll or PHP7.dll from: http://windows.php.net/download/.
Copy the downloaded php5.dll or php7.dll to C:\xampp\php.
Start Apache and MySQL from XAMPP Control Panel.

Categories