Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: yannlog on January 19, 2005, 02:06:42 PM
-
Hello,
Is anybody know this kind of problem :
Warning: open_basedir restriction in effect. File is in wrong directory in /home/e-smith/files/ibays/monintranet/html/index.php on line 3
Warning: Failed opening 'include.inc.php' for inclusion (include_path='.:/usr/share/php') in /home/e-smith/files/ibays/monintranet/html/index.php on line 3
Line 3 = include ('lib/include.inc.php');
It seems it doesn't want to go to this lib. Why ?
Another problem :
Call to undefined function: my_header() in /home/e-smith/files/ibays/intranet/html/index.php on line 10
My code is the following :
------ Page Index.php ------------------
<?php
include('lib/include.inc.php');
$titre = 'Intranet';
echo My_Header($titre);
?>
<?php
echo My_Footer();
?>
-----------------------------------------
files in the lib :
include.inc.php
lib_general.inc.php'
style.css
------ include.inc.php ------
<?php
session_start();
require('lib/lib_general.inc.php');
include('lib/connexion_base_donnees.inc.php');
?>
------------------------------------------------------
file lib_general.inc.php :
------ lib_general.inc.php ------
<?php
function my_header() {
global $date;
global $heure;
$date= date("d-m-Y");
$heure= date("H:i");
$retour = '
<html>
<head>
<title>'.$titre.'</title>
<script language="javascript" src="lib/menu.js"></script>
<link href="lib/style.css" rel="stylesheet" type="text/css" />
<script src="lib/vscroll.js" type="text/javascript"></script>
<script type="text/javascript">
(... Here is the left menu)
<div id="centre">
';
return $retour;
} // fin de la fonction
function my_footer() {
$retour = '
</div>
<div id="pied"> intranet 2005 </div>
</div>
</body>
</html>
';
return $retour;
}
Thank you for answering this question.
Yann
-
You have to turn on includes In your php.ini file, The best way to test this is to put a test page in with these php code,
<?php
phpinfo();
?>
Phpinfo.php it call it whatever you like. Once you turn this on the look for the line "allow_url_fopen = 0"; you need a 1 to turn in On. Make the change in the php.ini file in the /etc folder (for some reason it On instead of 0 or 1) check to see that it works. If it does you then should change make the change permanent by changing the template – I am not sure how familiar you are with SME, but it uses a template system that overwrites the main config file when it reboots, so changing the php.ini file will work until you reboot.
The files are in /etc/e-smith/templates/etc/php.ini
copy them into /etc/e-smith/templates-custom/etc/php.ini (you may have to create the file with mkdir –p /etc/e-smith/templates-custom/etc/php.ini )
find the line in the file you need (here the php.ini file is broken out into several files, you’ll only need to change 65FopenWrappers, so if you want to just copy it, you’ll be fine.
Once there you want to run /sbin/e-smith/expand-template /etc/php.ini
This will expand the template in your php.ini file and the change will be permanent. There used to be a section in the handbook called Customizing the system / custom template modification. I can’t seem to find it in the latest documentation, if you find an older copy with this description, you can use it – I have used it on 6.01 to modify this exact file and it still works. Hunt around on line for some documentation on the process and read through till your ready to give it a try.