Solved

Compile php scripts as DSO

Posted on 2004-08-20
6
237 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

763 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

14 Experts available now in Live!

Get 1:1 Help Now