I'm running on OS X 10.5 (Leopard), and I want to update the current version of PHP 5.2.15 (cli) that I have to PHP 5.3 or even 5.4.
The matter is that I need to run some PHP snippets in my terminal, and the version that i have (PHP 5.2.15 (cli) (built: May 5 2011 18:56:00)) can't allow some functions. That's why I need to upgrade my current version.
I searched on the web, but didn't find anything. How can I do it ?
Thanks !
Step 1. install Homebrew
Step 2. install Homebrew-php
Step 3. install the php version you want
Step 4. happy php coding.
Alternatively, if you can't get this working (shouldn't be a problem but just in case), you can try using MAMP.
You shouldn't update the default PHP version but rather install it in, I believe its tmp in MacOSX. Download the source from PHP's website, then do the normal command line unzipping which is fairly easy to find online. The file itself knows where to put everything. And then just make sure that your path can point to that new PHP installation.
By typing `which php-filename' you can see if it already is in your path or not. Hope that gives you a bit of a better idea.
EDIT: Ok I correct my previous part on it being /tmp. From what I see its /var. Thats where OSX has defaulted new installations. This is what you should be doing as to not mess with the built in stuff. You never know when you might need it.
Related
I currently have PHP installed on Windows 10 via AMPPS which seems to have stopped being updated. The latest version of PHP available from the AMPPS GUI is 7.1.
I want the latest version of PHP, but it is very hard to find out how to get it. I have found this page: https://windows.php.net/download/ but there doesn't seem to an any installer or suchlike, and I have no idea which option to download or what to do once I've downloaded it.
Isn't there some simple way to do this? I have composer installed if that helps.
Maybe something like composer upadte-php from powershell or something equally simple and user-friendly? Or maybe php --update.
If not, could someone please explain the process in simple steps. I certainly need the new version in my system path too.
IMHO installing a second PHP installation on Mac OS El Captain and then changing the PATH variable to point at the new installation is complete BS. That is not the way OS should work and it's making me super annoyed that Apple expects us to do like that.
I want to do a proper installation of the latest PHP version and thus removing the old one.
Is this even possible? And if yes, how?
Thank you kindly for all help.
To clarify the question.
OS X comes by default with a PHP 5.5 installation (/usr/bin/php). Installing a newer version of PHP on OS X (e.g. Homebrew) will not replace this default 5.5 installation but will instead place a new PHP version in another location. It will link binaries in /usr/local/bin. To use the new PHP version you have to make sure /usr/local/bin comes before /usr/bin in your PATH variable.
The original poster does not want to update his PATH variable in this way and is asking for a way to update the original 5.5 installation from Apple instead of installing a new one next to it and perform some PATH variable magic.
I have the latest version of MAMP installed but i want it to run PHP version 5.4.
That version is included in the MAMP file dir. It is located…
-> bin/php/php5.4.42
but in the preferences pane there are only 2 PHP version options: 5.6.10 and 7
I want to do this a part of troubleshooting. i have a Drupal install and am getting the dreaded ‘White Screen of Death’. I’m trying anything and everything to get it working!
MAMP lets you choose from the last two versions of PHP installed in bin/php. If you want to use 5.4.42, just leave this folder and another one of your choice inside this directory (move the others somewhere else so you have a copy, just in case). When you restart MAMP you'll be able to choose your preferred PHP version in the Preferences.
You can download more versions at https://www.mamp.info/en/downloads/
The easier way is to use other localwebserver called Ampps, and after installing it you can choose the version you want by the simple interface it provide.
You click on PHP ==> Change PHP version, and it will show you versions from 5.3 to 7.0.
Here is the link: http://www.ampps.com/
Thanks a lot.
Today I have tried to install imagick in my xampp a hundred times. And I did it. If you have troubles, please try following these steps:
Since xampp is x86, check if your Image Magick (the program) is x86. If not, download the latest version here: imagemagick.org/script/binary-releases.php#windows
Please remember that u MUST download the Win32 dynamic at 16 bits-per-pixel.
Install Image Magick at C:\imagemagick.
Download the latest stable version of imagick here: . You MUST download the 5.x Thread Safe (TS) x86. The x in 5.x is the version of your PHP.
Put the php_imagick.dll in php/ext folder of your xampp installation.
Add this in your php.ini: extension=php_imagick.dll
Here is when I have a lot of trouble. If you try to start the server (or writing php in the console (start->cmd)), you will get an error. If that error says something like this: Unable to find the entry point for the procedure FlattenImages in the DLL CORE_RL_magick.dll it means that you're well underway.
Now, you must go into the installation folder of Image Magick and overwrite the DLL you downloaded with the php_imagick.dll. All of them start with the prefix CORE_RL_.
Once you overwrote all of them, you can try writing php in the windows console. I don't say something means that the imagick is functional (you can check in localhost/xampp/ > phpinfo() link. Personally, I had to install a new DLL: vcomp110.dll.
If someone has the same error as me (the system can't found the vcomp11.dd) download it here
Now, if you try executing php on console, or just initializing the apache module of xampp, you should not have errors.
Goodbye and hope I can help someone.
EDIT: when tried to convert some-img.bmp some-result.jpg in the console, I had this error:
convert.exe: unable to open module file 'C:\Users\my-acc\.magick\IM_MOD_RL_BMP_.dll': No such file or directory # ...
This happened when there is no folder .magick in my-acc. The thing you need to do is this:
Create a folder named .magick in the my-acc folder. Since the name starts with a stop, you need to create it through the console. Here are the commands:
1.1. c:
1.2. cd Users\my-acc
1.3. mkdir .magick
Go to C:\imagemagick\modules\coders and copy the entire files into the latest folder created.
Now, you will be able to use Image Magick through the commands or the PHP Classes.
On background, if you use Codeigniter, i have no idea how to use the image_lib with imagick. So, it's better with the own imagick classes. Here a simple example:
$image = new Imagick($upload_data['full_path']);
$image->thumbnailImage(250,0);
if($image->writeImage($upload_data['file_path'].$upload_data['raw_name'].'_thumb'.$upload_data['file_ext'])){
something here;
}
$image->clear();
This answer might be extremely naive, but, I've found that getting things done in Windows is generally too painful. Many people agree with that and have found solace in a tool known as "chocolatey".
First, install chocolatey on your Windows machine (super easy install instructions):
https://chocolatey.org/
Then, use chocolatey to install everything else that you need (imagemagick in this case):
https://chocolatey.org/packages/imagemagick
I suspect you might have to do some minor tweaking to configuration files after that, plus handle all of the "Windows permissions" needed to get things to work smoothly. Permissions are can be as simple (and not necessarily safe) as "full control" to some user, plus activating inheritance and overwriting all children's settings to use inheritance.
In short, install, configure, permissions, go.
PS. This answer might be incomplete/prototypical/experimental, since I don't run codeigniter, php, imagemagick on Windows.
This how-to of Winderfind is wonderful, but for me it was not yet complete to troubleshoot all problems. First of all, have a look at this tutorial:
http://hrt0kmt.hatenablog.com/entry/2015/05/27/170608
Secondly I discovered that not all versions of ImageMagick will work with all versions of php_imagick.dll. Check out my and others answers on this post for further troubleshooting:
ImageMagick supported formats no value
Great tutorial,
If you are running windows 11, and installing xampp with php 8.1, you need to install 64bit versions:
Win32 dynamic at 16 bits-per-pixel
Becomes
Win64 dynamic at 16 bits-per-pixel
And
5.x Thread Safe (TS) x86
Becomes
8.1 Thread Safe (TS) x64
If you've installed the 32bit versions (as I did), you can just download the 64bit versions and overwrite all the files. Then restart apache and it should start working.
Okay, so far ive been googeling and trying to find a solution for over 6 hours. normally i dont post questions because i feel the answer should be findable, but here goes nothing.
I need to work with PHP code that has implemented the memcache class. I use wampserver 2.2 as 64 bit install, with apache 2.2.2, php 5.4.3 (installed 5.3.13 too, to see if i could fix it in that version) and mysql 5.5.24
i have run the memcache service with both the memcached-win64-1.4.4-14.zip link and the memcached-1.2.6-win32-bin.zip link
I am now at a point where the feedback from wampserver i get is the following when (re)starting the apache module -> mem_cache_module, using the answers from a similar thread on stackoverflow.com/questions/3894065/php-memcache-dll-vc6-x64), in combination with php 5.3.13 64 bit:
PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
This is a lot further than i got with the other options, most (or all) results i can come up with seem to redirect to either a 32 bit dll (which i cant use since my wampserver is 64 bit) or with the wrong php version or api version (compilation date?) .. i do not think i am able to compile my own library to solve this.
I have added *extension=php_memcache.dll* to both php.ini files for both php versions and the dll files have been placed into the correct php/php5.x.x/ext/ folders of the wamp server
my assumption so far is that i need the php_memcache.dll compilated for 64 bit (x64) for php 5.3.13 on the 25th of may, 2010. That or i need to install a php version matching the binairy compiled on the 26th of june, 2009.
Do any of you have a soltion to my specific dillemma? Any help will be greatly appriciated.
I tried all dlls and none worked but suddenly the one given in comment by falcontoast http://www.mediafire.com/?8d3vd26z3fg6bf1 did work.
Will be glad if it works for someone :).
One must check architecture of the phpversion from phpinfo() and must use corresponding dll file. Also the version for memcached service should be of same type.
Try following steps that might work for you. Yes it did work for me when I almost gave up.
1 - Close all memcached services if any already running.
2 - get this service memcached-win64-1.4.4-14(find it) and install it and then start.(the ways to install are already given out there).
3 - get the dll file in comment by falcontoast and put that in extension(ext) folder.
4 - do the changes in php.ini file.
5 - restart the wamp server(probably exit it and then again start it).
If everything is done properly, then the program given here https://commaster.net/content/installing-memcached-windows should work fine.
Basically you need Memcache OR Memcached Library that match your PHP Executable. When I say match I'm not speaking of date but of code. The old PHP won't support new Memcache and vice-versa.
You can try to compile a special one just for your version of PHP (I tried once with other libraries it's not fun). Or you can find a version of PHP that would work with a version of Memcache but this new PHP will also need to work with your version of Apache...
After years of playing with that I just gave up and just used a unix system.
PS: Now that I think about it PHP already come with a correct version of Memcache... So your error may be just that you're using "new Memcached();" instead of "new Memcache();"
Thank you zzarbi!! Freaking finally, I have tried all possible dll's out there and the one you provided finally worked, all others gave Invalid Win32 application.
My setup is Wamp 64 bit with Apache : 2.4.4 MySQL : 5.6.12 PHP : 5.4.12 on Windows 8 64bit