namid Posted April 12, 2004 Posted April 12, 2004 admin/index.php calls the function tep_get_languages and returns Fatal error: Call to undefined function: tep_get_languages() in C:\Program Files\Apache Group\Apache2\htdocs\catalog\admin\index.php on line 58. I have tried searching on "tep_get_languages" as word or phrase with the Windows XP search option to locate the definition of this function but no .php files are found. In which php script should this function be defined? TIA Remy
namid Posted April 14, 2004 Author Posted April 14, 2004 I've searched the forums for a solution to the problem of an undefined tep_get_languages function. This problem is mentioned several times but I couldn't find a solution in any of the threads. Back to my set-up. What I think I've been able to establish is that all php scripts are called/included, and that the tep_get_languages function is defined in admin/includes/functions/general.php: function tep_get_languages() { $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order"); while ($languages = tep_db_fetch_array($languages_query)) { $languages_array[] = array('id' => $languages['languages_id'], 'name' => $languages['name'], 'code' => $languages['code'], 'image' => $languages['image'], 'directory' => $languages['directory']); } return $languages_array; } The constant TABLE_LANGUAGES is defined and correct. If the problem doesn't lie there, what else could make this function to remain undefined? What should I check and how? TIA Remy
namid Posted April 14, 2004 Author Posted April 14, 2004 Have tested this: 1. Moved tep_get_languages function definition from admin\includes\functions\general.php to admin\index.php just before the function is called. Get the same error: Call to undefined function tep_get_languages. 2. Commented out the call to tep_get_languages in admin\index.php. Then get the error: Call to undefined function tep_catalog_href_link. Only have these problems with admin. The catalog works fine. Any clues anyone? Remy
namid Posted April 15, 2004 Author Posted April 15, 2004 Found out some more: I start up the admin page by entering http://localhost/catalog/admin/index.php in the brower's address box. Correct? Then things go wrong at the first line in admin/index.php: require('/includes/application_top.php'); The catalog/includes/application_top.php gets called instead of the catalog/admin/includes/application_top.php. This has probably to do with the include_path directive in php.ini: include_path = "f:\php\includes;C:\Program Files\Apache Group\Apache2\htdocs\catalog;C:\Program Files\Apache Group\Apache2\htdocs\catalog\admin". But when I change this to the original setting of include_path = "f:\php\includes", application_top.php doesn't get found and this error is returned: Fatal error: main(): Failed opening required 'includes/configure.php' (include_path='f:\php\includes') in C:\Program Files\Apache Group\Apache2\htdocs\catalog\admin\includes\application_top.php on line 31. How can I set up php.ini for the correct includes to be found? TIA Remy
namid Posted April 15, 2004 Author Posted April 15, 2004 Solution to the undefined tep_get_languages function in catalog/admin/index.php For the correct includes (php files) to be found in both the catalag and the admin side of things, this setting in php.ini works for me: include_path = ".\;f:\php\includes;C:\Program Files\Apache Group\Apache2\htdocs\" So far I've only tested this for osCommerce in the document root of the Apache server. Next I will test how osCommerce behaves under virtual hosts. Remy
Recommended Posts
Archived
This topic is now archived and is closed to further replies.