I have done a manual install of php 5.4.7 on IIS 7.5 (no msi installer as far as I know) and am now attempting to install PEAR. The instructions for installing it here http://pear.php.net/manual/en/installation.getting.php are pretty useless as the go-pear.bat doesn't exist in my install of php. So instead I've followed the instuctions here but pretty much fall at the part which says to run php go-pear.phar from the command prompt. First I get a system error dialog saying "The program can't start because fbclient.dll is missing" which I dismiss, followed by "The program can't start because OCI.dll is missing" which I also dismiss, php then returns me to the command prompt.
I'm new to installing php and PEAR, in the past I've just used installers which generally worked fine. Any guidance on this would be much appreciated.
Thanks
Rich
Edit your PHP.ini file, and comment out the following extensions:
;extension=php_oci8.dll
;extension=php_oci8_11g.dll
;extension=php_pdo_oci.dll
;extension=php_pspell.dll
;extension=php_interbase.dll
Turns out none of those are actually included in the standard Windows PHP installation package, despite being left enabled in the PHP.ini files that are meant to be for Windows servers... opensource dumbasses.
Related
Background:
1. How can i install gearman php extension on Windows OS?
2. Installing gearman PHP extension on Windows using cygwin and pecl
Following the answer in 1. question, I've made my cygwin work, downloaded and compiled gearman, and got the first gearman worker example to work:
Problem:
To run the same example from PHP script, I still need PHP extension. Somewhere I've seen that I might get to install PECL extension using PEAR, so:
I've downloaded go-pear.phar into C:\...\php5.6.16
ran php go-pear.phar
installed PEAR in system mode -> success
Now I can do: C:\...\php5.6.16>pecl install gearman which gives:
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl
channel-update pecl.php.net" to update
downloading gearman-1.1.2.tgz ...
Starting to download gearman-1.1.2.tgz (30,961 bytes)
.........done: 30,961 bytes
3 source files, building
ERROR: The DSP gearman.dsp does not exist.
Which would indeed be a sorcery if it worked, as that extension should be probably built/compiled accordingly to PHP itself. What is the least painful way to make this work? Is there a way how to do this without installing Visual Studio? I've also seen Net_Gearman PEAR package that might perhaps be wrapped / tweaked to be used just as the PECL one?
I'm currently using WAMP3.1.1 with PHP5.6.16 it comes with + VC15 x64 Thread Safe PHP7.2.2, need Gearman to work with at least one of those two. Any help appreciated
I've followed these 2 guides:
https://www.sitepoint.com/compiling-php-from-source-on-windows/
https://wiki.php.net/internals/windows/stepbystepbuild
1. I've downloaded:
Visual Studio 2012
.NET Framework 4.7.1 (which at the end just flashed a message that it's already installed)
Windows SDK _X_EN_DVD.iso
php-sdk-binary-tools-20110915.zip
deps-5.6-vc11-x64.7z (dependencies)
php-src-php-5.6.16.zip (GitHub release)
2. Compiled PHP
(note this is all from Native Tools Command Prompt, I didn't even actually start VS at all)
used just configure --disable-all --enable-cli --enable-pdo
3. Tried to compile PECL Gearman
found out it can't really be done on Windows
4. Found Gearman wrapper for Windows:
mhlavac/gearman on GitHub
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
I was able to successfully install the mcrypt extension on Mountain Lion but I'm having a difficult time installing the extension on Mavericks.
For reference, I'm following this guide: http://www.coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-9-mavericks-development-server/
The only inconsistency I've noticed is that by running php -v from the command line, I'm showing PHP version 5.3.15 - whereas the web server appears to be running 5.4.17. I downloaded 5.4.17 to compile mcrypt.
Basically, everything runs according to plan until the very end. Rather than installing the shared extensions into the new directory, /usr/lib/php/extensions/no-debug-non-zts-20100525, I get a message that says:
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
EDIT:
The issue appears to be that the web server's PHP was compiled with module API: 20100525 and the system is still using 5.3.15 (which is API: 20090626), hence the error.
I'm assuming you can't (easily) update the system version of PHP. What do I need to do to get the module and PHP APIs to match?
Thanks in advance for any help.
For reference of others finding this thread..
Here is an automated Mcrypt installer for 10.8 and 10.9.
http://topicdesk.com/downloads/mcrypt/mcrypt-download
Less than a minute to install this way.
I noticed that php 5.4.17 is located in /usr/bin and 5.3.15 is in /usr/local/bin,
so I:
created symlinks in /usr/local/bin to phpize and php in /usr/bin.
After I verified that phpize -v and php were pointing to the correct version, it was simply a matter of recompiling the mcrypt extension. After doing so, the extensions were installed in the correct directory:
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20100525/
I think in retrospect all I needed to do was add /usr/bin to my path variable so that it checks /usr/bin before /usr/local/bin.
I have RabbitMQ running on one of our servers and am trying to connect to it via PHP. I am developing on a Windows7 machine and my first line of code reads:
$cnn = new AMQPConnection();
It gives me the error:
Fatal error: Class 'AMQPConnection' not found in
I know that it is something that I need to install but what is it ? I am new to PHP so a little help would be nice.
Ps: I can connect to the RMQ server via the RabbitMQ admin web interface.
Thank you
Jack
Installation guide for php_amqp 1.4.0 (Stable version):
Download proper package for your php version from https://pecl.php.net/package/amqp/1.4.0/windows
Unpack php_amqp.dll to X:/php/ext/ directory
Unpack rabbitmq.1.dll to X:/Windows/system (not system32) directory
Modify php.ini file and add "extension=php_amqp.dll" line at the end of extensions list
Verify module installation by executing command "X:/php/php.exe -m" in command line
Restart webserver
I am developing on a Windows7 machine
You may be out of luck using that specific code. That class is from the PECL aqmp extension. Inside the installation instructions, it states:
Note to Windows users: This extension does not currently support Windows since the librabbitmq library does not yet support Windows.
You will want to use another library to speak to your message queue instead.
The rabbitmq-c library supports windows now, and the php_amqp pecl extension builds on windows as well. The documentation just hasn't been updated, nor are there any official binary builds in the wild. However, I managed to get them to build and have some 32 bit dll's available for download here:
http://www.nathanjohnson.info/?p=77
# AMQP installation php.net:
Note to Windows users: This extension does not currently support Windows since the librabbitmq library does not yet support Windows.
But here at RabbitMQ website is a windows installer...
Apparently this php.net page is outdated
To install do like this:
Download the correct package for your php from this official PECL amqp 1.4.0 page
unzip
add amqp.dll to your php ext folder
add rabbitmq.1.dll to your windows system 32 folder.
This according to the post on the blog I found here i think it is from the same #NathanJohnson who posted also here.
How I got it working:
My System Config: Win 7 Pro, (x64) XAMPP running PHP 5.6(x86)
Follow instruction from here to install RabbitMQ:
https://www.rabbitmq.com/install-windows.html
Now download compatible extension from here
https://pecl.php.net/package/amqp/1.4.0/windows
in my case it is "5.6 Thread Safe (TS) x86"
Now from zip file (php_amqp-1.4.0-5.6-ts-vc11-x86.zip) downloaded copy dll "php_amqp.dll" to your php extension folder in my case it is "xampp/php/ext" and copy dll "rabbitmq.1.dll" to "Windows\system" directory.
now register your php_amqp dll in php.ini file as
"extension=php_amqp.dll"
now restart apache.
Done. Now you should not get AMQPConnection not found exception.
I'm trying to install XML_RPC2 package from PEAR library, but whenever I type a proper command (pear install XML_RPC2) I'm getting an error:
pear/XML_RPC2 requires PHP extension "curl"
No valid packages found
install faild
Strangely enough command
$ pear package-dependencies xml_rpc2
returns information "this package does not have any dependencies" (works fine in any other case).
I've also tried with older versions of XML_RPC2 - same thing. It's the first packege I have problem with.
I'm sure curl is enabled and it's work(tested). Beside that I have installed all others components listed on dependencies list(PHP 5.3, PEAR 1.9.2, Cache_Lite 1.7.9).
I'm working on standard WAMP installtion on Windows XP.
I'll be grateful for any help:)
Edit.
Final solution: WAMP has two locations of php.ini, one used by php scripts and one for console commands. The first one is located in a apache directory (ie wamp/bin/apache/apache2.2.21) and the second one is in the php directory (ie wamp/bin/php/php5.3). If you're enabling modules using options in WAMP's tray icon (PHP extensions or php.ini) you are editing php.ini file in apache directory so it will take effect only on script runed by a browser and not by a command line.
"cURL" is an extension, not a (PEAR-)package. See Manual for installation instructions.
Had this very same issue
1) on the cmd line:
php -me
this will show you weather the curl extension is enabled or not. you may check your php.ini and find out that it's enable but only php -me will tell if there is a problem.
2) user pear config-show
this will list your pear configuration. make sure that ext_dir is pointing to where your php extensions are located:
pear config-show
3) make sure all your pear settings are correct otherwise use the pear config-set to correct them (e.g ext_dir)
pear config-set ext_dir \your\php\ext
If you are sure about the curl extension being enabled just install XML_RPC2 using the nodeps option
pear install --nodeps XML_PPC2
Then you should be fine.