I was reading PHP documentation about how to disable the SQLite3 extension in PHP:
The SQLite3 extension is enabled by default as of PHP 5.3.0. It's possible to disable it by using --without-sqlite3 at compile time.
but i didn't realize how to use --without-sqlite3 ?
"Compile time" refers to when someones takes the PHP source code, and compiles it into binary files. Once PHP is installed from those binaries, there is no way to disable an extension that was included in the PHP binary. (You can disable extensions that are compiled into separate binaries, but that is not the case for the SQLite3 extension for PHP. So in order to disable SQLite3 in your PHP, you'd need to obtain the source code of PHP, and compile it manually; it's not an easy task, if you've never compiled something, but I'm sure there are walkthroughs you can find online, if you really need.
Related
I tried to import data from XML file using the importDump utility...
root#aace30d9b5f3:/var/www/html/mediawiki-1.36.1# php ./maintenance/importDump.php mrwiki-latest-pages-articles-multistream.xml
Got this error:
MWException from line 2108 of /var/www/html/mediawiki-1.36.1/includes/parser/Parser.php: PCRE needs to be compiled with --enable-unicode-properties in order for MediaWiki to function
I downloaded the source code of PCRE and run make / make install but that did not work. I am using the official docker image of mediawiki if that matters.
https://hub.docker.com/_/mediawiki
update:
I need to simplify what I am trying to ask...
Is PCRE compiled using --enable-unicode-properties in this dockerfile?
https://github.com/docker-library/php/edit/master/7.3/buster/apache/Dockerfile
Is that php image being used by mediawiki official repo?
https://github.com/wikimedia/mediawiki-docker/blob/51105612d2e1168f1b0545f47951847d63fb9613/1.36/apache/Dockerfile
PHP, unfortunately, usually uses its own PCRE library (from the manual: "By default, this extension is compiled using the bundled PCRE library"), as you can also see in this other answer.
What you need to do is recompile PHP itself in order to activate the PCRE changes. To do this you need to (you can do this on a cloned machine)
check out the exact PHP version
download and install the relevant source packages
get the exact compilation options from phpinfo()
change the PCRE options appropriately
make (you don't need install as you're not going use PHP in the cloned machine)
The only file that you need to change now is the basic PHP binary (/usr/bin/php, watch out for alternatives symlinks). If you used a cloned machine with the same distro and versions, you can easily rename that one binary on the original machine and move in the new one, and it will work (I've done this dozens of times), so you'll have the option to go back at any time.
Or you can install the development packages for PCRE on the cloned machine and supply --with-pcre-regex= and --with-pcre-dir= to the compiler. The new PHP binary will now use the system PCRE, so that pcretest -C will now yield reliable results. I am not sure whether you need the same PCRE version on both machines (you probably need the same major version, but a minor version mismatch shouldn't be a showstopper). Be aware that updating the system PCRE library might break compatibility with PHP if for any reasons the library calls change.
This is more of a general question but for reference, I read statements like: "Most of the shared hosting providers do not compile imagick extension with PHP, but imagick binaries will be available". I don't know what is meant by "imagick extension" and "imagick binaries"? To me, any non-txt file is a binary. Also, when we install a library like "imagick", are both these kinds of version installed? And what is the difference between them?
"Imagick extension" is the optional component of PHP that adds Imagick-related functions to the language.
"binaries" means programs that are compiled to machine code, as opposed to source code or scripts.
So they're saying that you won't be able to use the built-in Imagic functions in PHP, but you could execute the external programs using methods like shell_exec().
From php.net, I found this line :
As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default. http://php.net/manual/en/json.installation.php
So why this php extension still exist ? For example : php7.2-json
Are we talking about the same json extension ?
The fact that the extension is bundled (i.e. shipped inside the main zip without the need to download it from an external repository), or compiled (i.e. directly available from your PHP code without the need to explicitly activate it in ini files), does not mean that the source code of the extension was removed altogether.
The source code of many features in PHP is organised in extensions -- be them external, dynamic, or statically compiled and bundled).
You will still find the php json extension as a standalone lib ; but you should not need to install it on its own, nor activate it in ini files.
As the subject implies ..
What is the difference between the library in this link
http://ffmpeg.zeranoe.com/builds/
and the php-ffmpeg extension which we install it on wamp (for example).
It isn't complicated. One is simply a standalone FFmpeg binary that you can run from a terminal or other application. The PHP extension version is... a PHP extension.
If you were to use regular FFmpeg binaries, you could use PHP's exec() to run them, like you would run any external application.
Alternatively by using the PHP extension, you get extra functions within PHP itself that you can call to run FFmpeg functionality. It's a native binding that may also be more efficient.
Personally, I recommend going the route of a regular FFmpeg binary for portability. I've found that building the PHP extension is difficult, and almost nobody has it installed. On the other hand, it's very easy to find an FFmpeg binary so you don't have to build it yourself, and it isn't difficult to handle its STDIO streams depending on what you need to do.
I have compiled php with some optional extensions like APC (for caching),APD (for debugging) and other vital extensions. Now I need to install another extension called mhash (for encryption) and my question is that:
Do i need to recompile php from scratch including the previous extensions and the last one or it is possible to recompile php just with last one (hopefully the previous extensions still supported)??
The other compiled extensions will still work.