Upgrading PHP 5.4.0 in XAMPP for Windows? - php

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

Related

How to change PHP version in XAMPP?

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

How to install V8Js for PHP on XAMPP for Windows?

Been working for days now trying to find an easy way to install V8Js on XAMPP for windows, yet with no success.
I have downloaded the latest XAMPP version with PHP version 7.2.0 VC15, and followed the instructions in this blog post - https://blog.xenokore.com/how-to-install-v8js-for-php-on-windows/ - but to no avail. I don't see a mention to V8Js in the phpinfo, and when I try to use it I get an ERROR
Error: Class 'V8Js' not found in...
I have downloaded the dll files from here - https://blog.xenokore.com/how-to-install-v8js-for-php-on-windows/ - and used the latest 7.2.1 VC15 x86 ts version with no success.
Can anyone offer some help?
You need to download lasted php version from here instead https://www.apachelounge.com/viewtopic.php?t=6359
Then move a php_v8js.dll from php\ext into same directory on your local.
But with 5 files additional from root directory of php have to move into your apache\bin instead
icui18n.dll
icuuc.dll
v8.dll
v8_libbase.dll
v8_libplatform.dll
Be sure to have it in your php.ini, by adding the following line:
extension=php_v8js.dll
Then try to restart apache or check by command php -m, have fun.

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.

Install PHP 7.0 Internationalization extension (Intl) on XAMPP on Mac

I followed the instructions outlined here:
Install PHP Internationalization extension (Intl) on XAMPP on Mac
Ran sudo pecl install intl
selected the correct files from the Cellar
then this error happened:
/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error:
'ext/standard/php_smart_str.h' file not found
include
^ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed
No matter, did some research and found out that PHP 7.0.8 deprecated php.smart_str.h to php.smart_string.h
So given my scant knowledge of C++ I copied smart_string.h to smart_str.h and renamed all the headers from STRING to string.....
re-ran pecl -no luck....more errors......without knowing where the .c files are and remaking php (not really interested in going that far) since anyway I'm using XAMPP so that ended that option.
I have php 5.5 on my mac, deep in the usr/local/bin folder
so next step was to get pecl to use those files and generate an intl.so file....
Did that....I have the intl.so file so put it in the 'extensions' folder in XAMPP (for reference: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012)
Ran php and came up with this error:
Warning: PHP Startup: Unable to load dynamic library
'/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so'
- dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so,
9): Symbol not found: _zval_used_for_init Referenced from:
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
Expected in: flat namespace in
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
in Unknown on line 0
I imagine it has to do with different versions?
In any case I can't get pecl to install intl without a make error in PHP 7.0.8 on XAMPP. There is no documentation on this and you'd think that if you deprecate a header.h file you'd update all extensions?
Install intl.so in PHP 7 seems impossible?
After a lot of research I was finally able to resolve this. Detailed steps here:
before you begin, check which php path is set. it should be /Applications/XAMPP/xamppfiles/bin/php. If not you can change it by PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}". more detail here
Overall idea is to build the intl-extension from PHP source code on your own. Before you begin make sure you have installed Xcode. Also, install the latest version of autoconf. this might help:
brew install autoconf
Next download the version of PHP you use in XAMPP from php.net. I am using 7.1.18. This version worked for me: php-7.1.31, I’m guessing if you follow the steps it might work for 7.0 or 7.2 as well. Do let me know if it does or doesnt, I’ll update this post. Do not use PHP 7.3 for Magento 2.3.0, it is not supported.
Extract the tar.gz file using (I extracted it inside ~/Downloads/ folder )
tar -xzvf php-7.1.31.tar.gz
cd into the extracted folder
cd php-7.1.31
change to subfolder ext/intl
cd ext/intl/
Run these commands to build the extension
/Applications/XAMPP/bin/phpize
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
make
sudo make install
you can now delete all files you downloaded and also the extracted folders.
Open /Applications/XAMPP/xamppfiles/etc/php.ini , and add extension=intl.so
Restart your Apache using XAMPP GUI and it should work.
So far, it seems that extension intl.so for php is bundled with php
and should be compiled with php (intl --enabled). XAMPP does not support this (as of Oct 2016), MAMP does. I do not know about other distros. However, if you're willing to recompile PHP 7, it's worth it just to do that and enable it during compiling.
So....I ran with MAMP. Then I decided that I would simply install apache 2.4 and php 7 and Mysql without the stack and the junk that comes with MAMP or XAMPP and everything works like a charm... so if you need to use CakePHP or intl support etc... just drop XAMPP/MAMP and go with a standard install. I used homebrew (MacOS) and everything is working fine.
Update: As regards Windows, XAMPP does not default it, but you can add the module (dll) in php.ini and works like a charm
The error means that XAMPP doesn't have PHP compiled with intl. You may try:
pecl install intl
but probably it won't work as well.
See: PHP Bug #72879 Pecl install intl make error with PHP 7.0.8.
As for the workaround, try installing memcached extension instead of memcache, e.g.
pecl install memcached
Note: It also requires libmemcached package/library to be installed beforehand. For macOS, install via: brew install libmemcached.
If you wanna try without homebrew, with native apache and php, look at my aswer here: https://stackoverflow.com/a/55131868/3692846

Unable to install composer

I am unable to install composer on my local system. Following are my local system and PHP details:
OS - Windows 8.1 Pro - 64 Bit OS - X84- based processor
I have installed XAMPP -
PHP Version 5.6.8.
On trying to install composer, it requested PHP_pdo.dll. However, I downloaded the dll and placed it into the xampp/PHP/ext folder
But seems some versioning issue. Where can I get PHP_pdo.dll for PHP Version 5.6.8 VC11 X84?
composer is installed using the PHP CLI (Command Line Interface)
The php.ini that controls the CLI is in your \xampp\php folder (its not the same one that controls PHP under Apache).
Edit \xampp\php\php.ini and make sure that
extension=php_pdo.dll
is not commented out, a comment has a # in column 1
That said, you had better get the original php_pdo.dll back that was in xampp\php\ext as there is no way of knowing if you put a good or bad new version in when you did whatever you did with the new one

Categories