Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2006, 06:16 PM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default PATH_SEPARATOR already defined??

I am following a tutorial primarily to learn MySQL and PEAR. I'm been using PHP5 with Apache on my development system with no issues. I installed MySQL 4.1.20 and current version of PEAR (both appeared to load correctly).

ISSUE: when loading my index page, I get the following:
Notice: Constant PATH_SEPARATOR already defined in C:\My Documents\Web Business\tshirtshop\include\config.inc.php on line 25

//config.inc.php - line 25 referenced:
  define("PATH_SEPARATOR", ";");

//The complete code line 25 is associated with:
if ((substr(strtoupper(PHP_OS), 0, 3)) == "WIN")
  define("PATH_SEPARATOR", ";");
else
  define("PATH_SEPARATOR", ":");
ini_set('include_path', SITE_ROOT . '/libs/PEAR' .
         PATH_SEPARATOR . ini_get('include_path'));

If I comment out the following lines: (see below) the Notice goes away

//if ((substr(strtoupper(PHP_OS), 0, 3)) == "WIN")
// define("PATH_SEPARATOR", ";");
//else
// define("PATH_SEPARATOR", ":");
ini_set('include_path', SITE_ROOT . '/libs/PEAR' .
         PATH_SEPARATOR . ini_get('include_path'));

I don't believe I am connecting to the MySQL database ("tshirtshop") I set up.

I recognize that the number of variables that may be impacting this could be infinite. I, however, need to begin debugging this with the help of someone with far superior experience with PEAR and MySQL than I. I have attempted, through trial and error, to figure this out (primarily due to the fact that I didn't even know how to ask for help with this issue until I found this group).

Much appreciation for any and all input/help resolving this issue.

Les
 
Old July 13th, 2006, 03:19 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It seems like two things are requiring or including config.inc.php, and therefore PHP tries to execute the code twice. The fix would be to use require_once or include_once instead of require or include, respectively. If you do this, PHP will make sure the include doesn't get executed twice and therefore fail.

The question is, however, what's including config.inc.php twice? Is some library you're using including it explicitly? It seems weird that PHP would run into this error with a default configuration.

Jon Emerson
http://www.jonemerson.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Connection user-defined type not defined Wall st Guru Excel VBA 2 March 26th, 2014 03:44 PM
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
...not defined Adam H-W Javascript 2 October 28th, 2004 09:18 AM
Application-defined or object-defined error James Excel VBA 1 August 12th, 2003 11:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.