PHP on Windows does not include php_phar.dll which means that
when installing pear i have to do it like this php -d phar.require_hash=0 go-pear.phar because it would not install Graph part of pear
I cant use MakeGood for unit testing in Eclipse
I cant use phar in general
is there a way to get to the php_phar.dll or pear community just decided that they wont support windows servers?
The phar extension is now a part of PHP that cannot be removed (statically built), so you do not need a .dll file for it.
Run php -m to see it listed.
Related
When trying to use gRPC from Windows with PHP, I could find Windows binaries for "protoc.exe" and "php_grpc.dll" but I have not been able to find any "grpc_php_plugin" (exe or dll?) and thus have not succeeded to use gRPC from Windows/PHP.
Documentation page:
https://grpc.io/docs/quickstart/php/
The current documentation at the above paqe is unix-oriented (with "make grpc_php_plugin" and "bins/opt" paths in flags such as --plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin).
However, it kind of seems as Windows should be supported since the page does mention "Install on Windows You can download the pre-compiled grpc.dll extension from the PECL website."
On the other hand, if only two of the three needed binaries are available, then it is not enough, since as far as I understand, the following three binaries are needed:
"protoc.exe" (indeed available in "protoc-3.11.4-win64.zip" )
"php_grpc.dll" (indeed is available in "php_grpc-1.28.0-7.4-nts-vc15-x64.zip" )
(and I am using 64 bit Windows 10 with nts/non-thread-safe PHP 7.4.4)
"grpc_php_plugin" (exe or dll?) NOT (?) available for Windows?
When trying to use the example at the quickstart page, you find this example command:
protoc --proto_path=examples/protos --php_out=examples/php --grpc_out=examples/php --plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin ./examples/protos/helloworld.proto
The problem is the plugin flag "--plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin".
When using Windows, you have not compiled with "make grpc_php_plugin" but need to download a binary for Windows and put it in a Windows path instead of the "bins/opt/grpc_php_plugin".
So, if anyone has actually been able to use gRPC for PHP with Windows 10, then please explain to make it work regarding the "grpc_php_plugin" which seems to be needed but not available.
Here is grpc_php_plugin.exe and some others: https://github.com/aaapi-net/protoc-windows-gen-plugins
Just download it and use the following command:
protoc -I proto/ --php_out=proto --grpc_out=proto
--plugin=protoc-gen-grpc=./grpc_php_plugin.exe example.proto
Install plugins from more reliable source than git above
Download and install http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20200602.exe
Open installed Msys2
Update packages: pacman -Su
Install grpc-plugins: pacman -S mingw-w64-x86_64-grpc
Your plugins are here: C:\msys64\mingw64\bin
or
You can just download http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-grpc-1.29.1-1-any.pkg.tar.zst
Open it with zstd plugin http://facebook.github.io/zstd/
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'm trying to save an old, failing web-server setup consisting of Fedora, PHP, PEAR, and Oracle.
With some difficulty (I'm very new to all four), I've been able to set up something similar on a newer system. I used Fedora 19, PHP 5.5.4 (with Apache 2.4.6), and Oracle 11g.
That just leaves PEAR.
Now, from what I understand, PEAR is some PHP code, like a library, which PHP Web Applications can use to save time from having to code them again - database connection, for example.
But I don't know what to do with it, or even how to get it. Copy paste from my old system? Download using the CLI using yum? Are there packages I need to be aware of, or is it just a one download-one install thing?
For instance, a basic PHP webpage with the following code:
<?php
phpinfo();
?>
works fine on the new server setup, so I'm assured that everything else is working. But when I try to load the PHP files from the other server, it returns an Internal Server Error. I checked the error_log files under /etc/httpd/logs, and most of the errors appear as below:
PHP Fatal error: require_once(): Failed opening required 'MDB2.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/hrweb/includes/functions.php on line 4
EDIT:
According to the PEAR Website, PEAR is included upon the installation of PHP, though not all modules / packages are there. Typing in the command pear in the CLI does confirm it is installed, though it does not help the issue.
I got the MDB2 package via pear install MDB2, though apparently, MDB2_Driver_oci8 is required. Whenever I try to download that, I get the following:
"MDB2_Driver_oci8" version "1.4.1" does not have REST XML available
In addition to this, I also tried to download OLE, which gets me the following:
No releases available for package "pear.php.net/OLE"
This was also previously the error of trying to download MDB2_Driver_oci8.
Thanks.
You have to install the (surprise!) MDB2 package to get MDB2.php:
$ pear install mdb2
and the adapter of your choice:
$ pear install mdb2_driver_mysql-beta
Then make sure the PEAR php directory is in your include path - see the PEAR manual.
"MDB2_Driver_oci8" version "1.4.1" does not have REST XML available
try to install the beta version:
$ pear install mdb2_driver_oci8-beta
No releases available for package "pear.php.net/OLE"
You're trying to install the stable version, but OLE does not have any stable version (yet): http://pear.php.net/package/OLE/download
Append either -alpha or -beta after OLE:
$ pear install OLE-beta
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.
I've been trying to install some PECL extensions on my laptop, but I've ran into a few problems. Whenever I run pecl install whatever from the command line I get a message saying ".\php.exe appears to have a suffix .exe, but config variable php". It seems like PECL is using PEAR to perform installations. I checked and php_suffix is located in the files PEAR_Config.php and PEAR_Builder.php, but I'm not sure what to do with it in there.
Any ideas on how to fix this or workarounds? Unfortunately the pecl4win seems to be down, and http://downloads.php.net/pierre/ the site I usually go to for the .dll's has outdated versions for the version of PHP I'm using (5.3.1).
Unfortunately I don't know the specifics, but at least I can point you in the right direction To use pecl on windows, you need to setup Visual Studio c/c++ or MingW32 c/c++ and then configure pecl to use either compiler for building the requested extensions.
Unlike pear packages, pecl packages are PHP c extensions that needed to be compiled against your local PHP install.
Update
https://wiki.php.net/internals/windows/stepbystepbuild A mostly friendly wiki page on setting up a windows box for building PHP from source. Looks like you need to build the interpreter and support libraries before you can get pecl working.