Solved

Compile php scripts as DSO

Posted on 2004-08-20
6
239 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

816 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now