LGB
LGB

Reputation: 718

How can I write a custom PHP extension which can modify the internals of the PHP interpreter?

Is it possible to write a PHP extension (UNIX, CGI SAPI) where I can:

Currently I've modified the PHP source itself, but that's ugly and maybe dangerous as well, it would be nice if I can do this as a PHP extension, well, at least with something looks like a PHP extension :) so I don't need to modify the "core PHP" ...

Thanks a lot in advance!

Upvotes: 4

Views: 528

Answers (2)

halfdan
halfdan

Reputation: 34204

Regarding points 2 and 3:

  • A "before php script execution hook" already exists in form of the php.ini option auto_prepend_file.
  • You can use .user.ini to override specific ini-options

Upvotes: 2

user673046
user673046

Reputation:

There are quite some Howto articles and references on the web explaining basic Hello World and beyond.

Good luck.

cu Roman

Upvotes: 3

Related Questions