Talk:PHP configuration

Jump to navigation Jump to search
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of (even if they share the same username).

File uploads with safemode on worked for me. The uploads only failed if apache was the owner of the directories.

The PHP CGI cannot be accessed directly[edit]

Hi, I successfully installed mwiki but I get the message mentioned above. I read that I have to change the php.ini. Because I have a managed server and cannot access the php.ini I created one and put the following sequence into it: "cgi.force_redirect = 1" . Without any success.

Can anybody help carolus

PHP is reporting the wrong URL to the config program. Set it manually in LocalSettings.php. --brion 08:05, 11 September 2005 (UTC)

PHP max and min versions[edit]

There is a recommended version on the front page, but does mediawiki run well with PHP5? How about PHP6 which will be out RSN?

PHP with mysqli?[edit]

I have mysqli installed on my system. Can I use MediaWiki? 01:54, 14 June 2006 (UTC) I went through the Database.php file, and I noticed that all the database callas are in the format mysql_*. I would guess then that if I wanted to use mysqli, I would have to replace all those calls with the matching mysqli_* call. Is that correct? Thanks, -- Anca.

I think so. You're better off consulting's documentation to make sure that there aren't any incompatibilities between the two. — Ambush Commander(Talk) 22:28, 14 June 2006 (UTC)

The latest version of PHP has deprecated ext/mysql. (

Compile-time options[edit]

PHP5 also needs support for


If not sure, which PHP-Version you are running, create a new php file and load it in your browser:


$array = gd_info();
foreach ($array as $key => $val)
   if ($key != "GD Version") {
       if ($val == true || $val == false) {
       if ($val == true) {
           $val = "Enabled";
       elseif ($val == false)
           $val = "Disabled";
   echo "$key: $val <br>";

print "---- End gd_info() ---- \n";

PHP error[edit]

I have no idea what to do now. I got the wiki files all set up, went to my page, clicked "set up the wiki", and this came up "PHP 5.0.0 or higher is required. ABORTING.". How do I fix it?--X66x66 18:23, 4 April 2007 (UTC)

MediaWiki >1.7(?) runs only on PHP 5+. --.anaconda 19:08, 4 April 2007 (UTC)
Oh, I should cross this out because I got a lower MediaWiki version and fixed it.--X66x66 17:09, 5 April 2007 (UTC)

Using NuSphere PHPExpress accelerator[edit]

I'm testing NuSphere PHPExpress on my Windows development box and mediawiki seems to be working perfectly fine with it. As the installation is very simple (it's just a dll that has to be copied in the \ext folder of php and you have to add extension=phpexpress[..].dll in php.ini and restart Apache) I think it would be worth mentioning it on the page. The only - I would find about it is that the cache size is fixed at 8MB but it seems to be enough for mediawiki (my install caches about 3MB of mediawiki php files). Here's the product page... It's also listed in Wikipedia here

Instead of NuSphere which lacks the G in gNU use XCACHE[edit]

Its open sauce and works good with mediawiki

Use mysqli[edit]

The native mysql extension is deprecated and is going to be removed soon. It should be replaced with the far newer mysqli or PDO. As far as I can tell, mysql has been around since before the turn of the century and is only changed for critical bug fixes, whereas mysqli and PDO are actively maintained. I could begin work on doing a patch to use the new extensions, however we would have to decide which (or both) to use. User:Iggyvolz, but you'll probably find me on Wikia 22:24, 11 August 2014 (UTC)

That's odd, it looks like mysqli is already in the source code but it's not being used in mw_config... can anyone clear me up on this? User:Iggyvolz, but you'll probably find me on Wikia 23:25, 11 August 2014 (UTC)
MediaWiki uses mysqli functions by default, and only mysql if mysqli is not present. In Database.php:
final public static function factory( $dbType, $p = array() ) {
		$canonicalDBTypes = array(
				'mysql' => array( 'mysqli', 'mysql' ),
				'postgres' => array(),
				'sqlite' => array(),
				'oracle' => array(),
				'mssql' => array(),
So if you choose mysql as the database engine, it will try to use mysqli functions first, if they're installed, and mysql as a last resort. --Ciencia Al Poder (talk) 11:16, 22 August 2014 (UTC)
So this page is incorrect when it says that mysqli is not supported? 2620:11E:1000:120:3EA9:F4FF:FE85:CA50
It does not say mysqli is not supported. It says MySQLi, MySQL and PostgreSQL through PDO are not supported, but with the php extensions it is supported. --Ciencia Al Poder (talk) 18:31, 5 January 2017 (UTC)

Outdated section Opcode caching[edit]

PHP_configuration#Opcode_caching should read about PHP's own OPcache. --Unsigned, 2016-05-12