can someone in this universe give me the step by step to install PECL for windows on php server, so then i can use the SpiderMonkey js engine to run js within php code?
Unfortunately the pecl4win site lacks due to limited resources. Pierre, our windows build master, creates extensions randomly on request and makes them available via http://downloads.php.net/pierre/ until the new PECL infrastructure is ready.
If you need an extension not available there you might ask on the pecl-dev at lists.php.net mailing list.
Also http://wiki.php.net/internals/windows/stepbystepbuild has some instructions. The build system on windows currentlydoesn't allow building extensions stand-alone, but you have to build from the PHP source tree. For adding oauth you either have to put the sources under php-src/ext/oauth before running buildconf.bat or use the --extra-ext-dir (or similar) option for buildconf.bat.
Related
Previously, I used package managers (i.e. YUM) to install and configure PHP. However, I would like to upgrade to PHP 7 and the package manager(s) available do not yet have PHP 7 available natively.
The plan is to use Chef to compile PHP on the server (during Setup) from original source. With that said, this process can take ~15 minutes on our server and will severely impact boot time.
Are there any techniques for increasing the speed at which the PHP
is compiled?
Can I create a tarball of final binaries and simply
download these to my servers?
There are some online resources that suggest adding the "webtatic" repo to YUM to access PHP 7. Is this safe/secure + reliable?
I am looking for freedom to upgrade my PHP version independent of when the package manager supports the version I am interested in
We ended up waiting for Ubuntu 16.04 which brings in PHP 7 via apt-get. Compiling PHP from scratch didn't turn out to be an efficient nor maintainable process
I created an extension for djondb, it's a wrapper of the library which is a C++ Library, I compiled it and it's available to be downloaded from djondb site, I'm not an expert on PHP and I've been having some problems with the distribution, mainly I realize that I need to do each compilation for each platform and create an installer for each one, which is time consuming, what I want it's a to ditribute the source code and allow the user to install it in the easiest way,
What I already tried:
Using phpize, configure, make, sudo make install the user can install the library very easy on Linux and Mac, the problem with this is that users need to have g++, make, etc installed on their computers, and this process of installation does not work on Windows.
Compile for each platform (Linux x86, x64, Mac, Windows, etc), and upload each tar.gz to the site, the user download it and place each file in the correct folder. the problem here is that the configuration is too manual and the users tend to miss some step, and it's not user friendly. The other problem is that I need to compile each version using a virtual machine and that's time consuming. (Now I'd to include versions for PHP 5.3 and 5.4, this means 8 virtual machines to create all the binaries)
I tried to create an account on PEAR but the registration screen always said that I dont need an account for the purpose I'm creating... (seems that it's a common problem in PEAR system but didnt find how to create the account to propose the package).
Did a proposal on PECL but nobody answered to the mailing list, seems that it's very common too.
So I'm stuck at this moment with the 1 and 2 ways to distribute, what is the best way to distribute a PHP extension that is created using C++ in a user friendly manner and easy to install?
Thanks in advance, you can see the code of the project at https://github.com/djondb/djondb_phpext if you have more questions about how the project is structured or the full explanation of the phpize/configure/make process.
Take the middle road: Distribute the source for Linux / OS X users, who can build it themselves, and offer compiled DLLs for Windows users. That will at least limit the number of versions you need to compile.
As a PHP developer who maintains the extensions we use in our company, it is PERFECTLY fine to give only the source code and expect the users to compile it on their machines.
If you want to be nice, compiling a version for each machine you support yourself, is also an accepted way (See Zend for example) and leave it somewhere easy to download (like sourceforge/github etc).
Then, just listen to the users and improve your (release) system as you go.
I just fail to understand why couchbase does not provide a php extension for use on "windows" & IIS 7. Is there some efficient other ways of connecting & working with couchbase using php on windows?
I just set up the Couchbase client library today (PHP 5.4 NTS under IIS7). The directions posted at Couchbase's page for the PHP Client Library are accurate for the most part but I wanted to clarify where the dlls go.
Download the zip containing php_couchbase.dll and libcouchbase.dll. Generally you will want the NTS (non-thread safe) version under IIS.
Put php_couchbase.dll in the extensions directory.
Put libcouchbase.dll in the php directory (same directory as php.exe/php-cgi.exe).
If necessary, install the Visual C 9 runtime from Microsoft.
Enable the extension in php.ini
I initially put libcouchbase.dll in the extensions folder per the directions on the Couchbase site. That will not work. (Generates the PHP "the specified module could not be found" dll load error.)
The above only gives you the Couchbase client. You also need a server; that can be locally on the Windows machine or somewhere else.
The Couchbase client SDKs are quite important because they are "cluster aware".
The SDKs, including the PHP one will automatically use all the nodes of the cluster using vBuckets and they will be notified when the topology changes (add new nodes, failover, ...)
Also if you are using Couchbase 2.0 the SDK provides you API to call the views and do more advanced queries on documents.
So the best practice is to use the PHP SDK, that use internally the memcached protocol.
I am inviting you to read:
- http://www.couchbase.com/docs/couchbase-devguide-2.0/couchbase-clients.html
- http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-introduction-architecture-vbuckets.html vBuckets used to manage the auto-sharding.
- http://www.couchbase.com/develop/php/next the PHP SDK main page
A more advanced topic that explains how to developer a client SDK:
- http://www.couchbase.com/docs/couchbase-devguide-2.0/creating-client-library.html
I suppose you are referring to Couchbase 1 (and not the 2.0 version which is currently in Beta).
Couchbase is compatible with memcached. That means you can use any memcached-compatible client to access it, e.g. PHP's memcache or memcached functions.
Update:
If you want to get your hands dirty and compile the PHP extention for the Couchbase SDK yourself, here is a tutorial that guides you through the process.
After compiling PHP from source are the devel libraries still needed?
For example, I am building a newer version of PHP from source than is on our dev servers. I installed alot of [extension i.e. mysql, postgresql, curl, etc]-devel packages in order for the configure from the dev server setup to work. Do i still need these after php has compiled? For example could I make a distro and then distribute the PHP distro to another server without needing these devel dependencies?
I am a bit of a noob to this.
You don't need to ship the devel-libraries.
But my advice is to take some time and learn how the build system of your linux distribution works. And then build a new php package that can be installed by the package manager.
Take a look at how the "original" php packages were built for the distribution. Most likely you can simply copy and edit the existing rule file(s) and then make a new version of that package. This way you take advantage of the dependency mechanisms and the package manager will not remove/overwrite your version so easily when an update shows up in the "official" repositories.
I found a few related posts here but didn't get my answer. So posting again.
How would I install a PECL extension on windows? Say I want the PECL oAuth extension on Windows XP.
I know 2 methods, but none of them is working for me.
The site http://pecl4win.php.net/ is down for months. So I cant download the DLL. Is there any place we can download the DLLs from ?
running the command
pecl install oauth-0.99.9.tgz is throwing the error
The DSP oauth.dsp does not exist.
I tried with few other extensions also and getting the same error.
What am I missing here?
Releases can now be found here:
http://windows.php.net/downloads/pecl/releases/
If you need an extension not available there you might ask on the pecl-dev at lists.php.net mailing list.
I got what I am looking for in http://windows.php.net/downloads/pecl/releases/
Currently PECL for windows is in an odd reformation state. The reason being that I believe they are trying to provide VS2008 source versions. I would actually suggest using Zend Server for now until the windows half of the php group gets everything fixed up. Zend Server includes almost all of the extensions that you can find in PECL, and everything else, if you are lucky, you could find an compile yourself.
The PECL installer downloads the source code of the extension and tries to compile it with your local C compiler. The problem is that the whole process is designed for Unix systems, where a C compiler is available or can be easily installed. Setting an environment to compile C code under Windows is pretty complicate.
The ideal solution is getting a DLL file that someone already compiled. That's what the pcle4win site was for. However, there's currently no official repository to download PECL DLLs so you only have two alternatives:
Find an unofficial DLL somewhere in Google
Compile it yourself (another link) with Microsoft Visual Studio
It'd be cool that there was a DLL repository out there but I'm unaware of any.
The php source ships with a set of configuration scripts for windows (using windows script host) that mimics the autoconf tools as far as php is concerned. If you place the code for the extension in a directory under the /ext directory (where all the other extensions like bcmath, bzip, ... are located) you can let the buildconf-script create a makefile that includes the build rules for that (new) extension.
There's a step-by-step walk-through at http://wiki.php.net/internals/windows/stepbystepbuild which seems to be brief but feasible.
compiled oauth: http://windows.php.net/downloads/pecl/releases/oauth/
another pecl extension: http://windows.php.net/downloads/pecl/releases/