Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Compile php scripts as DSO

Posted on 2004-08-20
6
240 Views
Last Modified: 2008-03-10
Good day!

I would like to know if it is possible to compile a php script as a DSO under Apache and Linux. (How?)

If not, how would I create a DSO (under Apache and Linux) that can receive "POST" and "GET" and connect to a MySQL Database?

Thanx in advance!

p.s the keyword here is "free product" - Zend compiler is out of the question.

-RR-
0
Comment
Question by:rogueripper
  • 2
  • 2
6 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 11851822
If your apache is complied with DSO support you can easy configure php to be used as a DSO by compiling PHP with the option

./configure --with-apxs=`which apxs` (apache 1.3)
./configure --with-apxs2='which apxs2` (apache 2.0)
make
make install

see http://de3.php.net/manual/en/install.unix.apache.php or http://de3.php.net/manual/en/install.unix.apache2.php
0
 

Author Comment

by:rogueripper
ID: 11868877
Hi hernst42

I would like to compile a php script as a DSO and not the php interpreteritself. I want to leave the php interpreter as a 3rd party installation away from apache.

Thanx!
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 11868985
I don't think it is possible to to compile a php-script so it is usable as standalone without any php-interpreter.

To create such a DSO you have to register certain functions in apache for your DSO and you have to write that DSO in C. A good start might be the SAPI-handler for apache in the PHP-souces (sapi/apache) or you look at other apache-modules like mod_mysql, but that will be a lot of work to realize such a thing.
0
 

Author Comment

by:rogueripper
ID: 11878688
Hi hernst42

Thanx for the help!

I suppose that what I am trying to achieve is not possible.

If I compile the php interpreter as a DSO, would I be able to use the php functions in a C script? and then compile that script as a DSO?

-RR-
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question