Last modified: 2014-02-12 23:32:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T3965, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 1965 - Problems when ini_set() is disabled
Problems when ini_set() is disabled
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.20.x
All All
: Lowest normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 60658
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-24 12:43 UTC by vga
Modified: 2014-02-12 23:32 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description vga 2005-04-24 12:43:02 UTC
i have a problem with the installation of mediawiki 1.4.2 to the internet. i can 
install it on my computer quite well and can use it, but when i want to try it in the 
internet i face with three problems :
(1.) After "You'll have to set the wiki up first!" page, i see warnings and a fatal 
error:

Warning: ini_set() has been disabled for security reasons 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia1/config/index.php on 
line 117

Warning: main(includes/Defines.php): failed to open stream: No such file or directory 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia1/config/index.php on 
line 121

Fatal error: main(): Failed opening required 'includes/Defines.php' 
(include_path='.:') 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia1/config/index.php on 
line 121



i could have been able to pass the problem by hacking the codes in config/index.php --
 i have changed the relative addresses of include or require pages with putting ../ 
before the pages.
 
Then the second problem comes :

(2.) in the installation process, the last requirement(!) wanted to be fulfill, but i 
dont have a root access due to hosting company does not give them. From here, the 
mediazilla, i have seen a clue to hack the config/index.php file by changing the 
DBuser and DBpasswords with my accounts in database. Therefore the installation 
process was finished. 

At the end of the installation process i have seen the note to copy the 
config/LocalSettings.php file to the main root of the wiki. i did. and change the 
permissions of the config folder to 0 pr 400, i think i is not problem.
Then faced with the 3rd problem :

(3.) when i open my site, i see the below warnings :

Warning: ini_set() has been disabled for security reasons 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/LocalSettings.php on 
line 8

Warning: Cannot modify header information - headers already sent by (output started 
at /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/LocalSettings.php:8) 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/includes/OutputPage.ph
p on line 383

Warning: Cannot modify header information - headers already sent by (output started 
at /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/LocalSettings.php:8) 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/includes/OutputPage.ph
p on line 316

Warning: Cannot modify header information - headers already sent by (output started 
at /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/LocalSettings.php:8) 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/includes/OutputPage.ph
p on line 344

Warning: Cannot modify header information - headers already sent by (output started 
at /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/LocalSettings.php:8) 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/includes/OutputPage.ph
p on line 345

Warning: Cannot modify header information - headers already sent by (output started 
at /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/LocalSettings.php:8) 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/includes/OutputPage.ph
p on line 347

Warning: Cannot modify header information - headers already sent by (output started 
at /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/LocalSettings.php:8) 
in /usr/hosts/domains/tawish/www.tawish.org/httpdocs/tatarpedia/includes/OutputPage.ph
p on line 396


And can not overcome the problem for several days. Is there anybody to help me, and 
solve the problem.. What can i do, i am not a programmer, but only a person who wants 
to upload mediawiki to the internet and share documents, articles with other people 
like wikipedia.

Thanks a lot for your help..
Comment 1 JeLuF 2005-04-29 09:27:23 UTC
Is there a way to change the include path without calling ini_set?
Comment 2 Brion Vibber 2005-04-30 02:09:58 UTC
There is a set_include_path() and get_include_path() as of 4.3.0. We could perhaps try 
using it if available.
Comment 3 vga 2005-05-01 12:41:26 UTC
i have put # before ini_set( "include_path", ...  in LocalSettings.php and it worked, but from 
the beginning to now. i have always omitted some needed (i think) rows so my site is may have 
problems in the future..  does not seem so for now..

thanks a lot.. 
Comment 4 Michael Schuster 2005-10-31 20:38:43 UTC
Disabled ini_set()

If the php-function ini_set() has been disabled for security reasons you have to
change some paths. The row-numbers are for version 1.5.1. In the file
config/index.php:

    * 122: require_once( "includes/Defines.php" );
      => require_once( "../includes/Defines.php" );
    * 123: require_once( "includes/DefaultSettings.php" );
      => require_once( "../includes/DefaultSettings.php" );
    * 124: require_once( "includes/MagicWord.php" );
      => require_once( "../includes/MagicWord.php" );
    * 125: require_once( "includes/Namespace.php" );
      => require_once( "../includes/Namespace.php" );
    * 166: require_once( "install-utils.inc" );
      => require_once( "../install-utils.inc" );
    * 167: require_once( "maintenance/updaters.inc" );
      => require_once( "../maintenance/updaters.inc" );
    * 465: require_once( "maintenance/InitialiseMessages.inc" );
      => require_once( "../maintenance/InitialiseMessages.inc" );
    * 1284: require_once( "languages/Names.php" );
      => require_once( "../languages/Names.php" );

In the file includes/DefaultSettings.php:

    * 27: require_once( 'includes/SiteConfiguration.php' );
      => require_once( '../includes/SiteConfiguration.php' );

Then you can run the script index.php again. Don't take notice of the fatal
error in includes/DefaultSettings.php. Just reload the page. After moving
config/LocalSettings.php to the folder above you have to comment out the
ini_set() in LocalSettings.php:

    * 8: ini_set( "include_path", ".:$IP:$IP/includes:$IP/languages" );
      => #ini_set( "include_path", ".:$IP:$IP/includes:$IP/languages" );
    * 12: ini_set( 'memory_limit', '20M' );
      => #ini_set( 'memory_limit', '20M' );
Comment 5 Rob Church 2005-12-14 23:20:16 UTC
Closing due to lack of feedback for a while, and the fact that a viable
workaround exists.
Comment 6 janrei.g 2007-05-02 14:50:12 UTC
Are there chances that MediaWiki will take care of environments where ini_set 
is disabled?

There is at least a warning during install (I didn't manage to install 
MediaWiki yet but this is most likely a differnt issue):
Warning: ini_set() has been disabled for security reasons in /srv/www/httpd/
phost/j/de/pytalhost/jansspielwiese/web/scripts/wikit/config/index.php on line 
33
Comment 7 Chad H. 2011-05-05 19:24:05 UTC
Now that we're looking to support HipHop, and HH doesn't support ini_set() for a majority of the parameters, it's a good time to take a look at all of our ini_get|sets in core and clean them up.

A general wfIniGet( $param, $defaultVal ) would be useful as a wrapper.
Comment 8 Chad H. 2011-05-26 21:07:06 UTC
Installation -> General. We need to cleanup ini_set/get() everywhere.
Comment 9 Christian Kujau 2013-03-21 19:25:05 UTC
MediaWiki 1.20.2 here with ini_set() disabled as well. One load of this wikis frontpage produces 12 lines of PHP warnings:

PHP Warning:  ini_set() has been disabled for security reasons in ../includes/db/Database.php on line 702
PHP Warning:  ini_set() has been disabled for security reasons in ../includes/db/Database.php on line 712
[...]

There are quite a few places where ini_set/get is used:

$ egrep -rl 'ini_[gs]et' .
./includes/AjaxResponse.php
./includes/GlobalFunctions.php
./includes/AutoLoader.php
./includes/LocalisationCache.php
./includes/StreamFile.php
./includes/OutputHandler.php
./includes/OutputPage.php
./includes/filebackend/lockmanager/DBLockManager.php
./includes/filebackend/lockmanager/MemcLockManager.php
./includes/UserMailer.php
./includes/WebStart.php
./includes/db/DatabaseMysql.php
./includes/db/Database.php
./includes/WebRequest.php
./includes/normal/UtfNormalMemStress.php
./includes/HttpFunctions.php
./includes/installer/WebInstallerPage.php
./includes/installer/Installer.php
./includes/objectcache/MemcachedPeclBagOStuff.php
./includes/parser/Preprocessor_DOM.php
./includes/specials/SpecialUpload.php
./includes/upload/UploadFromFile.php
./includes/ScopedPHPTimeout.php
./maintenance/deleteImageMemcached.php
./maintenance/dev/includes/router.php
./maintenance/Maintenance.php
./maintenance/preprocessorFuzzTest.php
./maintenance/backup.inc
./maintenance/backupTextPass.inc
./tests/parser/parserTest.inc
./tests/phpunit/includes/parser/NewParserTest.php
./tests/selenium/SeleniumTestConsoleLogger.php
./profileinfo.php

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links