How to compile php with sqlite3 support - php

I want to compile php sqlite3 with custom compile option. to do that I followed following steps
wget http://be.php.net/distributions/php-5.3.10.tar.gz
tar -xvf php-5.3.10.tar.gz
cd php-5.3.10/ext/sqlite3
Run phpize
But I am getting error:
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
How can I solve this problem ?

Seems like already reported bug
https://bugs.php.net/bug.php?id=53571&edit=1.

Related

Having issues creating an php extension

I try to make a custom php extension for code Encryption purposes,
I followed this tutorial to make an custom extension: How to make a PHP extension
i get this warning when compiling the extension:
WARNING
The following arguments is invalid, and therefore ignored:
--enable-php-helloworld
i did all according to the tutorial, i build on windows.
what are possible things i do wrong.
I followed that section: https://stackoverflow.com/a/32575493/3103078
I replicated the code 1:1 (Os: Windows)
used commands:
phpize
configure --enable-php-helloworld
nmake
php -d extension=php_helloworld.so --re php_helloworld
Expected result:
>>>helloworld support
Actual Result:
>>>
reproduction:
mkdir php
start https://altushost-swe.dl.sourceforge.net/project/winflexbison/win_flex_bison3-latest.zip
set path=%path%;C:\your_path\to\bison
start https://altushost-swe.dl.sourceforge.net/project/gnuwin32/sed/4.2.1/sed-4.2.1-bin.zip
set path=%path%;C:\your_path\to\sed
start https://codeload.github.com/skvadrik/re2c/zip/refs/tags/2.1.1
set path=%path%;C:\your_path\to\re2c
start https://download.microsoft.com/download/5/C/3/5C3770A3-12B4-4DB4-BAE7-99C624EB32AD/windowssdk/winsdksetup.exe
rem after install
set path=%path%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64
start https://windows.php.net/downloads/releases/php-devel-pack-7.3.29-Win32-VC15-x64.zip
rem install upper in php dir
phpize
configure --enable-php-helloworld
nmake
php -d extension=php_helloworld.so --re php_helloworld
The issue was not utilizing the php-src inside the sdk.
Also, on windows you need to use php-sdk-binary-tools, else it wont work when you compile it.
I'll do a tutorial on this soon.

How to compile PHP from source on MAC / OSX

Just for learning purposes, i tried to compile the current php source code from github, following the install instructions (see link).
I know that there are many other ways to achieve to install php like with homebrew and so on, but i am really interested in the way to compile it by myself just for education.
At first, i stumbled upon the fact, that there is no ./configure, even if the install document tells to execute this script.
So i googled around and found the following command to produce a ./configure - script:
$ autoreconf -i
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
glibtoolize: putting auxiliary files in '.'.
glibtoolize: copying file './ltmain.sh'
glibtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.in,
glibtoolize: and rerunning glibtoolize and aclocal.
glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
No the file exists, but the execution of that script failed with a missing install-sh/install.sh/shtool:
$ ./configure
checking for grep that handles long lines and -e... /usr/local/bin/ggrep
checking for egrep... /usr/local/bin/ggrep -E
checking for a sed that does not truncate output... /usr/local/bin/sed
configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."
So i installed shtool via homebrew, but the same error still occurs.
Who can help me?
If you download the source from php.net, e.g.
http://php.net/downloads.php
It comes with a working configure

Error while building php extension on Ubuntu

I installed php5-dev, get php source, placed hello_world extension in
<php_source>/ext/hello.
I run this commands in hello dir:
phpize
./configure --enable-hello
make
But I have error: php.h not found :(
I tried to run ./configure in php source path, placed files from Zend/, TSRM/, main/ dirs to /ext/hello dir, but after running make I have many-many compiling errors. What I am doing wrong?
Try with
./configure --with-php-config=/path/to/php/bin/php-config --enable-hello

phpize reports "Cannot find config.m4"

I am trying to run the 'phpize' command on MacOSx Mountain Lion, but this is what I get:
Cannot find config.m4.
Make sure that you run '/opt/local/bin/phpize' in the top level source directory of the module
How do I resolve this error ?
The phpize command is meant to be run at the top level of an extension source dir (this source dir should contain a file name config.m4).
See http://php.net/manual/en/install.pecl.phpize.php for more information.
In plain English, it means you're running the command from the wrong directory. You need to be in the directory that contains the source for the extension you're trying to install.
For example, if you're trying to install mcrypt, like I was when I came across this stack overflow page, you need to be in php-5.6.24/ext/mcrypt and then run the command.
My problem was that I was trying to execute the command just to see if I had it installed.
Trying to execute the command alone gives you that error, only use it inside the directory (most likely you downloaded) that contains the extension that you're trying to install.
Here some instructions to install Xdebug for php7.2 for example.
Take special care in step 3 and 4, first you change dir to the unpacked downloaded extension and then you run phpize.
http://qiita.com/MasatoYoshioka#github/items/e542f39a6f1a3bc1f71e
In terminal
ls config.m4
ls config*
config.w32 config0.m4
cp config0.m4 config.m4
cd /usr/local/src/php-5.3.29/ext/zlib
phpize
./configure
make clean && make && make install
nano php.ini
add extension=zlib.so
got inside the xdebug folder than try to run the phpize
Sometimes, using the pecl installer is not an option. This could be because you're behind a firewall, or it could be because the extension you want to install is not available as a PECL compatible package, such as unreleased extensions from git. If you need to build such an extension, you can use the lower-level build tools to perform the build manually.
The phpize command is used to prepare the build environment for a PHP extension. In the following sample, the sources for an extension are in a directory named extname:
$ cd extname
$ phpize
$ ./configure
$ make
# make install
first run ./configure it will create config.m4 file, rest the steps are same

Error with phpize in SLES

I'm trying to run the phpize command, but i keep getting this error message:
Cannot find config.m4
Make sure that you run '/usr/bin/phpize in top level source directory of the module
I have already installed php5-dev.

Categories