I wish to do some MediaWiki hacking which uses the codebase, specifically the parser, but not the database or web server. I'm running on Windows XP on an offline machine with PHP installed but no MySql or web server. I've unarchived the source and grabbed a copy of somebody's LocalSettings.php but not attempted to to install MediaWiki beyond this.
Obviously I don't expect to be able to do much, but when I try to run any of the maintenance scripts I get no output whatsoever, not even errors.
I was hoping to let the error messages guide me as to what is essential, what needs to be stubbed, wrapped etc.
Am I missing something obvious or do these scripts return no errors by design?
Andrew Dunbar (hippietrail)
* Andrew Dunbar hippytrail@gmail.com [Tue, 16 Nov 2010 23:01:33 +1100]:
I wish to do some MediaWiki hacking which uses the codebase, specifically the parser, but not the database or web server. I'm running on Windows XP on an offline machine with PHP installed but no MySql or web server. I've unarchived the source and grabbed a copy of somebody's LocalSettings.php but not attempted to to install MediaWiki beyond this.
Obviously I don't expect to be able to do much, but when I try to run any of the maintenance scripts I get no output whatsoever, not even errors.
I was hoping to let the error messages guide me as to what is essential, what needs to be stubbed, wrapped etc.
Am I missing something obvious or do these scripts return no errors by design?
Andrew Dunbar (hippietrail)
In the web environment, error messages may expose vulnerabilities to potential attacker. The errors might be written to php's error log, which is set up by
error_log=path
directive in php.ini. You may find the actual location of php.ini by executing
php --ini
Look also at the whole Error handling and logging section
Does php work at all? Is there an configuration output
php -r phpinfo();
when issued from cmd.exe ?
Does
php dumpBackup.php --help
being issued from /maintenance directory, produces the command line help? Dmitriy
On 17 November 2010 02:37, Dmitriy Sintsov questpc@rambler.ru wrote:
- Andrew Dunbar hippytrail@gmail.com [Tue, 16 Nov 2010 23:01:33
+1100]:
I wish to do some MediaWiki hacking which uses the codebase, specifically the parser, but not the database or web server. I'm running on Windows XP on an offline machine with PHP installed but no MySql or web server. I've unarchived the source and grabbed a copy of somebody's LocalSettings.php but not attempted to to install MediaWiki beyond this.
Obviously I don't expect to be able to do much, but when I try to run any of the maintenance scripts I get no output whatsoever, not even errors.
I was hoping to let the error messages guide me as to what is essential, what needs to be stubbed, wrapped etc.
Am I missing something obvious or do these scripts return no errors by design?
Andrew Dunbar (hippietrail)
In the web environment, error messages may expose vulnerabilities to potential attacker. The errors might be written to php's error log, which is set up by
error_log=path
directive in php.ini. You may find the actual location of php.ini by executing
php --ini
Look also at the whole Error handling and logging section
Does php work at all? Is there an configuration output
php -r phpinfo();
when issued from cmd.exe ?
Does
php dumpBackup.php --help
being issued from /maintenance directory, produces the command line help? Dmitriy
Thanks Dmitry. PHP does work. The --help options always work. It turned out the LocalSettings.php somebody on #mediawiki pointed me to require_once()'d several extensions I didn't have and require_once() seems to fail silently. I'll try to aquaint myself better with the Error handling and logging section as you suggest.
Is there somewhere an "official" blank or example LocalSettings.php file that would be better to use for people like me to avoid such problems? Rolling my own from scratch doesn't seem ideal either.
Andrew Dunbar (hippietrail)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Wed, Nov 17, 2010 at 3:32 AM, Andrew Dunbar hippytrail@gmail.com wrote:
Is there somewhere an "official" blank or example LocalSettings.php file that would be better to use for people like me to avoid such problems? Rolling my own from scratch doesn't seem ideal either.
Normally, you're supposed to use the installer. The installer will set up the database and create a LocalSettings.php for you.
Marco
* Andrew Dunbar hippytrail@gmail.com [Wed, 17 Nov 2010 13:32:25 +1100]:
Thanks Dmitry. PHP does work. The --help options always work. It turned out the LocalSettings.php somebody on #mediawiki pointed me to require_once()'d several extensions I didn't have and require_once() seems to fail silently. I'll try to aquaint myself better with the Error handling and logging section as you suggest.
require_once() should produce a warning on non-existent files. Warning reports should not be suppressed. For a development there should be
error_reporting = E_ALL | E_STRICT
in php.ini
Is there somewhere an "official" blank or example LocalSettings.php file that would be better to use for people like me to avoid such problems? Rolling my own from scratch doesn't seem ideal either.
Usually it's being produced by web installer. http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/config/Installer.php?...
New installer is large and I haven't studied it throughly. I am more often upgrading from old versions than install from scratch.
However, when upgrading from old version, you have to add new options manually by observing the HISTORY file. http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/HISTORY?view=markup
I wish the installer was able to parse original settings and warn of something outdated. However, that might make it really over complicated. Dmitriy
On Wed, Nov 17, 2010 at 2:27 AM, Dmitriy Sintsov questpc@rambler.ru wrote:
require_once() should produce a warning on non-existent files. Warning reports should not be suppressed. For a development there should be
error_reporting = E_ALL | E_STRICT
in php.ini
Or failing that, put at the top of LocalSettings.php:
ini_set( 'display_errors', '1' ); error_reporting( E_ALL | E_STRICT );
wikitech-l@lists.wikimedia.org