"Ashar Voultoiz" <hashar(a)altern.org> wrote:
news:44B37D4E.4010106@altern.org...
Bisset Doctoresse Jacqueline wrote:
<snip>
I moved the file LocalSettings.php in the parent
directory. But when
i point the link :
http://sciencemoleculaire.studentblog.org/angleterre/
i have the error :
Warning: main() [function.main]: open_basedir restriction in effect.
File(/usr/share/pear/UtfNormalUtil.php) is not within the allowed path(s):
(/home/httpd/vhosts/sciencemoleculaire.studentblog.org/httpdocs:/tmp) in
/home/httpd/vhosts/sciencemoleculaire.studentblog.org/httpdocs/angleterre/includes/normal/UtfNormal.php
on line 36
Warning: main(UtfNormalUtil.php) [function.main]: failed to open stream: Operation not
permitted in
/home/httpd/vhosts/sciencemoleculaire.studentblog.org/httpdocs/angleterre/includes/normal/UtfNormal.php
on line 36
Fatal error: main() [function.require]: Failed opening required
'UtfNormalUtil.php'
(
include_path='/home/httpd/vhosts/sciencemoleculaire.studentblog.org/htt…)
in
/home/httpd/vhosts/sciencemoleculaire.studentblog.org/httpdocs/angleterre/includes/normal/UtfNormal.php
on line 36
THIS IS THE PHP.INI :
http://sciencemoleculaire.studentblog.org/php.ini
Bonjour Jacqueline,
The problem comes from UtfNormalUtil.php :) It exists both as a PEAR
package and as MediaWiki file but the PEAR path (/usr/share/pear/) is
most probably before our paths.
The easiest way is probably to add /usr/share/pear/ to the open_basedir
restriction. I am not sure why it is used though, as we are supposed to
override the include path in localsettings.php:
----------------------------------------------------------------
if( defined( 'MW_INSTALL_PATH' ) ) {
$IP = MW_INSTALL_PATH;
} else {
$IP = dirname( __FILE__ );
}
$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) );
----------------------------------------------------------------
--
Ashar Voultoiz - WP++++
http://en.wikipedia.org/wiki/User:Hashar
http://www.livejournal.com/community/wikitech/
IM: hashar(a)jabber.org ICQ: 15325080
Bonjour. Can you tell me what exactly i need to do to correct the problem ?
What is the system to add /usr/share/pear/ to the open_basedir
restriction. I have added the line :
include_path = ".:/usr/share/pear" in php.ini but the error is not corrected.
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;
;include_path = ".:/php/includes"
include_path = ".:/usr/share/pear"
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
-------------
In vhost.http
i have put this file but it not work-
<Directory
"/home/httpd/vhosts/sciencemoleculaire.studentblog.org/httpdocs/">
php_admin_value safe_mode 0
php_admin_value open_basedir /usr/share/pear/
php_admin_value open_basedir /
</Directory>
---------------------------
I have found your lines in localsettings.php. But i don't understand what i need to do
? I have to delete all lines ?
----------------------------------------------------------------
if( defined( 'MW_INSTALL_PATH' ) ) {
$IP = MW_INSTALL_PATH;
} else {
$IP = dirname( __FILE__ );
}
$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) );
--------------
I need to modify also the file UtfNormalUtil.php ?
............
At the moment this is my localsetting.php :
<?php
# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
# If you customize your file layout, set $IP to the directory that contains
# the other MediaWiki files. It will be used as a base to locate files.
if( defined( 'MW_INSTALL_PATH' ) ) {
$IP = MW_INSTALL_PATH;
} else {
$IP = dirname( __FILE__ );
}
$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path()
);
require_once( "includes/DefaultSettings.php" );
# If PHP's memory limit is very low, some operations may fail.
# ini_set( 'memory_limit', '20M' );
if ( $wgCommandLineMode ) {
if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER )
) {
die( "This script must be run from the command line\n" );
}
} elseif ( empty( $wgNoOutputBuffer ) ) {
## Compress output if the browser supports it
if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' );
}
$wgSitename = "ANGLETERRE Science Moleculaire";
$wgScriptPath = "/angleterre";
$wgScript = "$wgScriptPath/index.php";
$wgRedirectScript = "$wgScriptPath/redirect.php";
## For more information on customizing the URLs please see:
##
http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
## If using PHP as a CGI module, the ?title= style usually must be used.
$wgArticlePath = "$wgScript/$1";
# $wgArticlePath = "$wgScript?title=$1";
$wgStylePath = "$wgScriptPath/skins";
$wgStyleDirectory = "$IP/skins";
$wgLogo = "$wgStylePath/common/images/wiki.png";
$wgUploadPath = "$wgScriptPath/images";
$wgUploadDirectory = "$IP/images";
$wgEnableEmail = true;
$wgEnableUserEmail = true;
$wgEmergencyContact = "jaqueline_bisset_fr(a)yahoo.fr"o.fr";
$wgPasswordSender = "jaqueline_bisset_fr(a)yahoo.fr"o.fr";
## For a detailed description of the following switches see
##
http://meta.wikimedia.org/Enotif and
http://meta.wikimedia.org/Eauthent
## There are many more options for fine tuning available see
## /includes/DefaultSettings.php
## UPO means: this is also a user preference option
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;
$wgDBserver = "localhost";
$wgDBname = " ..... ";
$wgDBuser = " ..... ";
$wgDBpassword = " ..... ";
$wgDBprefix = "";
$wgDBtype = "mysql";
$wgDBport = " ..... ";
# Experimental charset support for MySQL 4.1/5.0.
$wgDBmysql5 = false;
## Shared memory settings
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = false;
$wgUseImageResize = true;
# $wgUseImageMagick = true;
# $wgImageMagickConvertCommand = "/usr/bin/convert";
## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
# $wgHashedUploadDirectory = false;
## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX = false;
$wgMathPath = "{$wgUploadPath}/math";
$wgMathDirectory = "{$wgUploadDirectory}/math";
$wgTmpDirectory = "{$wgUploadDirectory}/tmp";
$wgLocalInterwiki = $wgSitename;
$wgLanguageCode = "en";
$wgProxyKey = " ++++++ ";
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue',
'monobook':
$wgDefaultSkin = 'monobook';
## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
# $wgEnableCreativeCommonsRdf = true;
$wgRightsPage = ""; # Set to the title of a wiki page that describes your
license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";
# $wgRightsCode = ""; # Not yet used
$wgDiff3 = "";
# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) );
$wgCacheEpoch = max( $wgCacheEpoch, $configdate );
?>
--------------------
At the moment this is my UtfNormalUtil.php :
<?php
# Copyright (C) 2004 Brion Vibber <brion(a)pobox.com>
#
http://www.mediawiki.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
http://www.gnu.org/copyleft/gpl.html
/**
* Some of these functions are adapted from places in MediaWiki.
* Should probably merge them for consistency.
*
* @package UtfNormal
* @public
*/
/** */
/**
* Return UTF-8 sequence for a given Unicode code point.
* May die if fed out of range data.
*
* @param $codepoint Integer:
* @return String
* @public
*/
function codepointToUtf8( $codepoint ) {
if($codepoint < 0x80) return chr($codepoint);
if($codepoint < 0x800) return chr($codepoint >> 6 & 0x3f | 0xc0) .
chr($codepoint & 0x3f | 0x80);
if($codepoint < 0x10000) return chr($codepoint >> 12 & 0x0f | 0xe0) .
chr($codepoint >> 6 & 0x3f | 0x80) .
chr($codepoint & 0x3f | 0x80);
if($codepoint < 0x110000) return chr($codepoint >> 18 & 0x07 | 0xf0) .
chr($codepoint >> 12 & 0x3f | 0x80) .
chr($codepoint >> 6 & 0x3f | 0x80) .
chr($codepoint & 0x3f | 0x80);
echo "Asked for code outside of range ($codepoint)\n";
die( -1 );
}
/**
* Take a series of space-separated hexadecimal numbers representing
* Unicode code points and return a UTF-8 string composed of those
* characters. Used by UTF-8 data generation and testing routines.
*
* @param $sequence String
* @return String
* @private
*/
function hexSequenceToUtf8( $sequence ) {
$utf = '';
foreach( explode( ' ', $sequence ) as $hex ) {
$n = hexdec( $hex );
$utf .= codepointToUtf8( $n );
}
return $utf;
}
/**
* Take a UTF-8 string and return a space-separated series of hex
* numbers representing Unicode code points. For debugging.
*
* @param $str String: UTF-8 string.
* @return string
* @private
*/
function utf8ToHexSequence( $str ) {
return rtrim( preg_replace( '/(.)/uSe',
'sprintf("%04x ",
utf8ToCodepoint("$1"))',
$str ) );
}
/**
* Determine the Unicode codepoint of a single-character UTF-8 sequence.
* Does not check for invalid input data.
*
* @param $char String
* @return Integer
* @public
*/
function utf8ToCodepoint( $char ) {
# Find the length
$z = ord( $char{0} );
if ( $z & 0x80 ) {
$length = 0;
while ( $z & 0x80 ) {
$length++;
$z <<= 1;
}
} else {
$length = 1;
}
if ( $length != strlen( $char ) ) {
return false;
}
if ( $length == 1 ) {
return ord( $char );
}
# Mask off the length-determining bits and shift back to the original location
$z &= 0xff;
$z >>= $length;
# Add in the free bits from subsequent bytes
for ( $i=1; $i<$length; $i++ ) {
$z <<= 6;
$z |= ord( $char{$i} ) & 0x3f;
}
return $z;
}
/**
* Escape a string for inclusion in a PHP single-quoted string literal.
*
* @param $string String: string to be escaped.
* @return String: escaped string.
* @public
*/
function escapeSingleString( $string ) {
return strtr( $string,
array(
'\\' => '\\\\',
'\'' => '\\\''
));
}
?>