It seems like PHP have removed dbx-extension as default install since version 5.
I am wondering, why? Is dbx out?
And where can I download the extension, I did google, but I can't find it.
Thank you.
From the PHP manual:
This extension has been moved to the ยป PECL repository and is no
longer bundled with PHP as of PHP 5.1.0.
PDO offers the same sort of functionality (single interface to multiple database types) so I assume you're expected to use that instead.
Related
Can the json extension be disabled in PHP? The doc says that:
As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default.
But some people in the comments say that the json extension is sometimes provided as a separate package.
Can the json extension be explicitly disabled, or can we be confident that it's always available?
Background: I want to make a class in a library of mine implement JsonSerializable, but that may be a BC break if the interface is not always declared, and the library suddenly relies on an extension that's not always available.
PHP 8:
No, the JSON extension cannot be disabled anymore.
PHP 7:
Yes, any PHP extension can be installed, uninstalled, enabled, or disabled at will.
The json extension - despite its ubiquity - is still just an extension and can be removed in this way as well.
There are a couple of cases in which the json extension might not exist:
The administrator disabled/uninstalled it:
;extension=json
The version of PHP that was installed was compiled from source manually, and the json extension was left out:
--disable-json
The extension is bundled as a separate package; for example, on Fedora you have to install the php-json package explicitly.
The important part of your question: Can we be confident that it's always available
Normally, I would say no. However unlikely the case is that this particular extension is disabled or left out, it still doesn't mean that it won't happen.
If your intended audience is limited to people who probably wouldn't touch those kinds of settings, then you might be safe, but there's no guarantee.
My suggestion: Build your library as a Composer package, and declare ext-json as a dependency. That way, you can provide installation instructions as a Composer package and if the underlying system doesn't meet your package requirements, the installation will fail and the user will be alerted to the missing extension.
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.
My PHP Version 7.2.3 and xampp pack do not have the mcrypt extension.
It is not mentioned in the phpinfo() neither in the php.ini file in order to enable it.
I have downloaded mcrypt from this link:
https://sourceforge.net/projects/mcrypt/
but I don't know how to integrate it as php extension.
I need solution for xampp in windows please
You don't
See http://php.net/manual/en/intro.mcrypt.php
This feature was DEPRECATED in PHP 7.1.0, and REMOVED in PHP 7.2.0.
Alternatives to this feature include:
Sodium (available as of PHP 7.2.0)
OpenSSL
They didn't include this one
PHPSecLib
But it's a third party library so I can't say I blame them, I've used it for some time and never heard anything bad about it yet.
Change PHP version to lower version, like "7.0.33" or below.
than it will help to achieve the code goal
I have the source for a PHP extension, and the compiled version for PHP 5.3. But I have PHP 5.4, and the project appears to have been abandoned.
So given the source code, what is the minimum I have to do to compile it for PHP 5.4?
EDIT Note: I'm on Windows.
It depends on the extension itself. If the extension requires some other libraries, like, say the mysql extension, then you also need the mysql client library - the C API. Why? Because you explicitly stated that you want minimal dependency requirements. If the extension does not require any other libraries, you can nicely open those C files that you already have, and compile it using any available C compiler. Naturally, you will need PHP development kit as well. :)
Now I'm seeking of php_pdo_mysql.dll version 5.2.5.5,
only found this:
http://dllcentral.com/php_pdo_mysql.dll/5.2.5.5/
But my zend studio 5.5 says it's invalid!
Is there any other place I can try my luck?
Brrr, I really wouldn't download binaries (that could do anything they please on the system, and possibly even the web pages that get served) from locations like that.
Isn't PDO included in PHP by default since 5.0?
From the PDO installation manual:
PDO and all the major drivers ship with PHP as shared extensions, and simply need to be activated by editing the php.ini file:
THe pdo extentions come default with php installation as far as I know.
You should try to uncoment the package in your php.ini file and then reload apache.
Looking at this I would have thought that you wouldn't need a DLL at all. From here:
PDO ships with PHP 5.1, and is
available as a PECL extension for PHP
5.0; PDO requires the new OO features in the core of PHP 5, and so will not
run with earlier versions of PHP.
Official binaries can be found at:
http://windows.php.net/download/
However, you say you already have a Windows binary. Look at it carefully: you should already have that DLL available. Probably, you need to rerun the installer and select that extension.