Am trying to install a package which has given instructions to use Buildconf from the root of php build directory. In my php build directory's root(/etc/php5), I don't find a Buildconf or Configure script. How do I get these? I installed my php5 using sudo apt-get(yes, I have an Ubuntu).
What you probably have installed is PHP binary package, i.e. already built one. If you need to build a stand-alone PHP module, you may want to install package php5-dev and use utility /usr/bin/phpize5 to generate config files.
If what you really need is PHP source, you may download it from http://www.php.net/downloads.php. After you unpack the package, buildconf will be there.
If neither of these is what you need, I guess it would be helpful to post the instructions you received.
Related
I use MAMP for local php development and recently needed to use php's pspell functions for a project. I found little help with this specific scenario (short of recompiling php, yuck) so this post explains how I got it done.
I am not positive but you may need xcode and xcode command line tools installed for this to work. This article might be helpful.
Install MacPorts if you don't have it already
Install aspell and the dictionary of your choice (I used "en"):
sudo port install aspell aspell-dict-en
note: for the next commands, you need to know the version of php you're running on MAMP. You can find this in the MAMP preferences under the PHP tab. For me it's 5.5.18
Download the php source for the version of php you are running,
unarchive it, and move into the pspell source directory:
cd ~/Downloads/php-5.5.18/ext/pspell
Now (being sure to use the proper phpize binary for your php version) do:
/Applications/MAMP/bin/php/php5.5.18/bin/phpize
You should see something like:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Next:
./configure --with-php-config=/Applications/MAMP/bin/php/php5.5.18/bin/php-config --with-pspell=/opt/local/
And finally, build the module file:
make
You should now have two files inside the ./modules/ directory: aspell.so and aspell.la - copy them into your php's extensions directory:
cp ./modules/* /Applications/MAMP/bin/php/php5.5.18/lib/php/extensions/no-debug-non-zts-20121212
Now add the extension to your configuration file in /Applications/MAMP/bin/php/php5.5.18/conf/php.ini
extension=pspell.so
Finally, restart your MAMP servers and (hopefully) you are good to go!
I am trying to install mbstring extension on heroku and the only info i found
on the web is this github site.
https://github.com/wuputah/heroku-libraries/tree/master/php
Generally the process is:
Download code in a heroku run bash that's a PHP app
/app/php/bin/phpize
./configure --with-php-config=/app/php/bin/php-config
make
When i run no 2 on and i got this, but i already at the root level of my site. Any idea?
Make sure that you run '/app/php/bin/phpize' in the top level source directory of the module
You'll want to use a custom buildpack with support built-in to PHP for that. Here's a shameless plug to the buildpack that I use that has support for most of the common requests for PHP extensions.
https://github.com/winglian/heroku-buildpack-php
I am trying to install the mcrypt PHP extension on my OS X Mountain Lion 10.8 operating system. This OS comes shipped with Apache and PHP already installed. The mcrypt extension however does not come shipped with PHP. I want to install mcrypt into the version of PHP that came shipped with my machine.
I do not want to use Homebrew, Macports, or any similar package manager, and I do not want to install another version of PHP in addition to the one I already have. I just want to plug mcrypt into the PHP that came bunded with my OS. I feel like this makes sense, instead of having multiple versions of the same program installed, yet every tutorial I come across seems to all immediately say to use Homebrew/Macports, and the few that don't teach you how to install a new PHP instead of using the one I already have.
I started following the directions laid out on this page: http://www.coolestguyplanettech.com/how-to-install-mcrypt-for-php-on-mac-osx-lion-10-7-development-server/.
I downloaded libmcrypt-2.5.8.tar.gz from Sourceforge.
I extracted the contents with the following command: tar -zxvf libmcrypt-2.5.8.tar.gz.
I entered the libmcrypt-2.5.8 directory that was created and issued the following commands: ./configure, make, and sudo make install.
Now that tutorial says to go into a directory that was created by a new, non-native version of PHP that the tutorial tells you to install, not the native version that came shipped with OS X. The tutorial says to go into the following directory: cd ../php-5.3.13/ext/mcrypt/ (which is a directory I don't have), and run the phpize command. I can't go into that directory because I'm using the native PHP that came with OS X, so instead I go into the libmcrypt-2.5.8 directory, but when I try to run the phpize command I get an error that says: Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module. I do however have the files acinclude.m4 and aclocal.m4 in this directory. I am not sure if they are related to the config.m4 that phpize is looking for.
I am not sure how to proceed. Maybe I should just cut my losses and install another PHP using Macports or Homebrew, but I'd really prefer to use the native PHP that came bundled with OS X. Can you help me figure out how to do this? It would really help me a lot, and help me understand better how PHP and extensions work. Thank you!
"I'd really prefer to use the native PHP that came bundled with OS X.
Can you help me figure out how to do this? It would really help me a
lot, and help me understand better how PHP and extensions work."
The PHP that came bundled with OSX isn't any more "Native" than any other version that you would install.
You don't have that directory because, IIRC, OSX doesn't ship with PHP source, just a compiled binary and apache module.
You can only run phpize on a php extension, which you can get in the PHP source download (including the mcrypt extension). What you downloaded is the C library (which you may also need to install) that the PHP extension will reference (you don't need to worry about how this happens).
If you want to just install that extension:
Download it
Extract and cd into
sudo phpize
sudo ./configure && sudo make && sudo make install
Add extension=mcrypt.so (or whatever is generated) to your php config / php.ini and restart apache
This sounds to me like a good opportunity to learn more about how your computer works. This is some documentation I wrote for myself a few years ago on how to do this:
http://www.calvinfroedge.com/common-php-compile-configuration-options/ (note that the formatting in the blog might not work if you paste it into terminal, for example –with-mysql should be --with-mysql)
Besides, you don't need to get rid of your PHP installation that came with OSX. You can download the PHP source to a brand new directory, compile it, backup the old binary, and either symlink the result of 'which php' to your new installation or add the binaries that get generated after you compile to your source.
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.
I want to add an extension so I can use my own function in php for example my codes of C but I don't know the requisites and instructions of doing it.I have php5 and OS:Opensuse 11.
I don't know about configure and the codes in shell
there should be something like ext_skel so I can create config files but I don't have it should I download it from somewhere?
Due to this link http://www.tuxradar.com/practicalphp/20/3/0
there should be ext directory but I don't have it.
Thanks in Advance
cd
vi ext/util/config.m4a
./build conf --force
./configure => i don't know here
You should download PHP and then change to the ext directory and follow the tutorial. Don't forget to compile PHP too, because the extension you create depends heavily on the PHP version. I've installed OpenSuse but I don't think it does affect building a PHP extension. You might need some compiler tools etc. I found /php-5.2.6/ext/ext_skel in my PHP path. I've PHP installed in my home directory. You need to install the sources. In OS it's zypper in php5-devel. You can also download the tarball from the PHP site.
Edit: Here is another tutorial about php extension programming.