Solved

Compile php scripts as DSO

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

867 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

15 Experts available now in Live!

Get 1:1 Help Now