Installing one PHP extension for a program on Windows - php

sorry if I seem like an absolute beginner at these things. I wanted to get the PHP extension for GEOS. I already have PHP (though XAMPP) and GEOS installed. Now, trying out the instructions on GitHub, I soon realize that these are instructions for Linux. I've been googling instructions for getting PHP extensions in Windows, but I've learned that it's not quite simple. Based on what I've found I would either need to
Use Visual Studio (which I would have to download first)
Find a dll (there is none)
Recompile PHP with the extension (not sure if I said it right)
So I have two questions: firstly, which of these options are most suitable for getting just one extension? And secondly, regarding the recompiling option, would I have compile things from a different source, since I got PHP from XAMPP and it doesn't seem to have the option to install the components separately.
EDIT: I believe that my question is not the same as this one because the user here actually found relevant DLLs, and did not have to compile anything or use Visual Studio.

Related

Recompiling PHP, when I've previously installed it with XAMPP

I'm on Windows 10, and I really need to install this PHP extension in order to use advanced GeoPHP methods. I've already asked about this previously here. There is no available DLL for this extension, and the instructions for installation on GitHub are for Linux. What I've understood is that I need to recompile PHP with the extensions in the ext folder, so I'm planning on doing that using these instructions. However, I've previously installed PHP through XAMPP.
My question is, will these instructions work with this? If yes, where can I find the PHP source files? I'm not quite sure what they look like, and googling "PHP source files location" gives me stuff about actual PHP files, not the ones used for installation. I just want to make sure. Thanks.
No, you do not have to recompile PHP. The module you stated is not baked into PHP but dynamically included.
Just build the module and include it like
extension=geos.dll
The Github link you posted does have instructions...

Pear DB Error: extension not found

I am still new to php and linux but i try to give you all information I know.
We got a PHP web application using pear and smarty. It's runing on PHP 4 on a Linux system and with XAMP and PHP5 on my PC. I am trying to move the application on a new server with PHP7 and updated PEAR and all extensions (it's the same version as on XAMP), but all I get is: DB Error: extension not found.
I tried to find a solution but wasn't able to find anything which could help me.
The database we are using is a normal mysql database.
I'm not sure if there is still a path missing or what went wrong.
Maybe someone of you got a clue what the problem could be.
It sounds like your very old PHP4 code is using the mysql_ database extension?
If so that extension has been deprecated for years and was completely removed from PHP7. You wont be able to move that code to any version of PHP higher than PHP5.6 and even trying to do that you will almost definitely come across lots of other incompatibilities
I suggest you read http://php.net/manual/en/migration70.php in the menu on this page there is a section on migrating from all sorts of versions of PHP.
You will have to work out how far up the migration levels your code will actually move without major amendments. I would guess, not very far!

Defeated trying to install mongodb PHP extension on MAMP

I've done all the things suggested by other answers to this question (or at least I think I have), but I'm still completely stuck.
The specific problem going on at the moment is that the compiler can't find zend_config.h. I have PHP 5.5.10, which came with my out-of-the-box MAMP install. My first attempts were failing because the compiler couldn't find php.h. It seems that I need the PHP source code in order to build the mongo driver. A surprise to me (perhaps I'm too much of a n00b), but ok.
Unfortunately, I could not find the source for 5.5.10, only 5.5.14. Who knows whether that's what I really need. Out of desperation, I copied the main and Zend folders from 5.5.14 to my 5.5.10 folder. So I have php.h, but now no zend_config.h. There are zend_config.w32.h and zend_config.nw under the Zend folder. I guess I could take a desperate measure again and try renaming one of these files to see whether the extension will build, but I'd rather hear from someone who knows what they're doing.
Other answers to this kind of question say that you need the XCode command-line tools. I'm running Mavericks, so I got the command-line tools for Mavericks. I have XCode 5.1.1; I realize that it's up to V6 now, but do I really need the latest version of XCode for this? The installation of MongoDB itself using homebrew was beautifully uneventful. I got the mongo extension source from github and I'm following the very brief instructions from that repo.
I'm amazed that installing a simple extension would be this hard. I sure hope mongodb is enough of a performance improvement to justify this much headache. Can anyone give me an idea of how to get this going?
I had this same issue. It might be the fact that MAMP uses it's own .ini file and seems to ignore the .ini file in it's own PHP conf folder.
Once i updated MAMP's own .ini file (stored in /Applications/MAMP etc...).
Check your phpInfo page and look for the following:
Loaded Configuration File: /Library/Application Support/appsolute/MAMP PRO/conf/php.ini

php_monetdb.dll

I need the php_monetdb.dll for php 5.4. I've found that by building the monetDB with the HAVE_PHP=1 option on windows will create the dll, but the build procedure fails at numerous points. I am using the monetdb source from sourceforge which is a little outdated one. The newer version has problems in the .msc files itself so proceeding to the build itself is a pain. The older version that I am trying on is atleast passing the nmake step but failing on the nmake install step. The reasons vary from component to component. One states that the devenv /build does not exist. For this I copied the vcexpress and renamed it to devenv. I am not sure if this is right but when I run it from the command prompt it seems to work ok with a few warning alerts shown. During other make installs, the header files seem to be missing. Could anyone please help me with this. Also please let me know if there is any other alternative for this approach of getting php_monetdb.dll.
P.S: I am using windows 7, MSVC 10 express, PHP 5.4.4
For the build questions, see http://bugs.monetdb.org/show_bug.cgi?id=3121
For php_monetdb.dll, see
http://sourceforge.net/mailarchive/forum.php?thread_name=20120717145132.GU49719%40cwi.nl&forum_name=monetdb-developers
http://sourceforge.net/mailarchive/forum.php?thread_name=500581D5.8030808%40acm.org&forum_name=monetdb-developers

PECL extension for Windows

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/

Categories