#20607 [Com]: function included from parent script gets lost

From: Date: Mon, 25 Nov 2002 06:28:03 +0000
Subject: #20607 [Com]: function included from parent script gets lost
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-25761@lists.php.net to get a copy of this message
ID: 20607 Comment by: nick@itomic.com Reported By: nick@itomic.com Status: Feedback Bug Type: Scripting Engine problem Operating System: red hat 7.2 PHP Version: 4.2.3 New Comment: ok index.php now reads (on the live site): <? ini_set("error_reporting", "E_ALL"); //echo "Error Level : " . ini_get("error_reporting") . "<br />"; require_once "it_functions/it_db.php"; $a = it_getnextid("table", "trjh"); ?> I dont get any msg at all now, but i should get an echo from it_GetNextID ... ? Previous Comments: ------------------------------------------------------------------------ [2002-11-24 19:27:32] nick@itomic.com yep, will do that, but im using other files in the same directory. also what is the function to get/set config options in php via the script? ------------------------------------------------------------------------ [2002-11-24 12:36:08] iliaa@php.net Looks like the include is failing, but the error is not being shown, could you increase your error level to display E_WARNING or change include_once to require_once. ------------------------------------------------------------------------ [2002-11-24 05:53:35] nick@itomic.com the only difference is in index.php: <? include_once "it_db.php"; $a = it_getnextid("table", "trjh"); ?> ------------------------------------------------------------------------ [2002-11-24 05:51:57] nick@itomic.com to see the above on my live server, goto http://www.blackisha.com/cms_phpbug_central/index.php to see the result if it_db.php is included within the same directory, goto http://www.blackisha.com/cms_phpbug/index.php ------------------------------------------------------------------------ [2002-11-24 05:46:06] nick@itomic.com ok, boiled it down to pretty simple code. The problem seemed to stem from the filename and position of it_db.php, which is in a default included directory .home/lib/it_functions/. In the following example, if it_db.php was included in the same directory, all was ok. if /home/lib/it_db.php was renamed to /home/lib/it_database.php (or any other name), the code works fine System: red hat 7.2 php 4.2.3 kernel 2.4.18pre3 apache: 1.3.27 php is an apache module file structure: /home/lib/it_functions/it_db.php (in central code repos): <?php // Get next available unique ID function it_GetNextID($table,$PrimaryKey) { echo "works OK <br />"; } // it_GetFieldNames - Get all field/column names of selected table and load into an array function it_GetFieldNames($table) { echo "works ok too <br />" } ?> blackisha.com/cms_phpdebug/index.php: <? include_once "it_functions/it_db.php"; $a = it_getnextid("table", "trjh"); ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/20607 -- Edit this bug report at http://bugs.php.net/?id=20607&edit=1

« previous php.bugs (#25761) next »