Hi Guys,

I have access to mini linux PCs that can serve up webpages using the Boa webserver. They also house an sqlite db file.

What I want to do is install the bare-bones of php with only sqlite and PDO functionality, so I can write to and display data from the databases on board with a php page (I already have the code working on a full version of php/apache on my full size machine, with a sqlite .db file copied across from the mini PC).

I guess it is not as simple as commenting everything out of php.ini that I don't need and deleting all the coresponding .dll files to reduce the size?? (it didn't seem to work when I tried it)

All the documentation I can find on the Boa webserver also suggests running php in cgi-mode, which again I've followed a few tutorials on without success.

Ideas/links/tutorials/hints/tips/tricks etc would be most welcome at this point!

Thanks in advance

Well you should be able to delete entire sections of your php.ini file and delete the extensions you don't want from the php.ini and from the file system but remember to keep the dependencies. That is some dll's rely on others. The dependencies documentation can be found at php.net. Also when changing the php.ini file remember to change the right php.ini file which can be found with the php_info(); function.

Thanks for the reply.

I've now managed to lay my hands on a working build; what it consists of is a php file (no extension) in the cgi-bin, and an html file containing:

<HTML>
<HEAD>
<TITLE>A test web page</TITLE>
</HEAD>
<BODY>
<P>
If you are seeing this page,  then your web server is working,  and now
you need to create some nice pages to replace this one.
<P>
PHP demo page <a href="/cgi-bin/php/index.php">/cgi-bin/php/index.php</a>

<P>
PHP Socket Test page <a href="/cgi-bin/php/ipv4loop.phpt">/cgi-bin/php/ipv4loop.phpt</a>

<P>
</BODY>
</HTML>

The index.php link brings up the phpinfo() no problem.

I Just need to replicate this with the sqlite support....

So I've been researching online and trying to build my own php binary by compiling the source code.

When I try the following:

./configure --enable-ftp --host=arm-linux --without-pear --disable-simplexml --disable-mbregex --enable-sockets --disable-libxml --disable-all --oldincludedir=/usr/local/arm-linux/include --with-zlib-dir=/usr/local/arm-linux/lib --enable-pdo=shared --with-sqlite=shared --with-pdo-sqlite=shared --with-zlib-dir

I get:

configure: error: Cannot find libz

I then spent a fruitless couple of hours trying to install zlib, but it was coming up with: "No rule to make Target 'libz.so', needed by 'install-libz'. Stop.

So I moved on (experimenting as I'm not too sure what those lines do anyway) with:

./configure --enable-ftp --host=arm-linux --without-pear --disable-simplexml --disable-mbregex --enable-sockets --disable-libxml --disable-all  --enable-pdo=shared --with-sqlite=shared --with-pdo-sqlite=shared

But then I get:

You've configured extension pdo_sqlite to build statically, but it depends on extension pdo, which you've configured to build shared.

So I finally tried:

./configure --enable-ftp --host=arm-linux --without-pear --disable-simplexml --disable-mbregex --enable-sockets --disable-libxml --disable-all  --enable-pdo=shared --with-sqlite=shared --enable-pdo-sqlite=shared

It builds it all, but then gives:

Notice: Following unknown configure options were used:

--Enable-pdo-sqlite=shared

I'm not even entirely sure on what to do with the output files to test them - As you can see I'm somewhat out of my depth!

Any tips, or suggestions for reading materials would be good

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.