Define Constants For Site (Chpt 3, Pg 58)
Posted 28 January 2012 - 12:28 PM
The second and third constants are set up:
define ('BASE_URL','www.example.com/'); line 8
define ('MYSQL', BASE_URL . 'includes/mysql.inc.php');
Is this defining the URL of the website and do I also need to change this URL in my php.ini file? This part doesn't make sense to me since I am using http://localhost/
These are my errors:
An error occurred in script 'C:\xampp\htdocs\index.php' on line 8:
require(www.example.com/includes/mysql.inc.php) [function.require]: failed to open stream: No such file or directory
Fatal error: require() [function.require]: Failed opening required 'www.example.com/includes/mysql.inc.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\index.php on line 8
In my php.ini file under paths and directories, it has:
; Windows: "\path1;\path2"
include_path = ".;C:\xampp\php\PEAR"
Does this need to be changed to www.example.com or do I change my constants to this path?
Posted 28 January 2012 - 2:12 PM
define ('BASE_URL', '/')
I have my site setup like this
define ('BASE_URI', 'http://localhost/knowledge_is_power/'); define ('BASE_URL', '/www/'); define ('PDFS_DIR', BASE_URI . '/pdfs/'); // Added in Chapter 5. define ('MYSQL', '/includes/mysql.inc.php');
I am also using the xampp localhost for running the knowledge is power website, the location of my index.php file is here
And on the c drive it is located at
This should be enough info for you to figure it out if the above what i have written doesn't happen to work.
Posted 28 January 2012 - 2:24 PM
Posted 1 February 2012 - 11:57 AM
define ('BASE_URI', 'C:\xampp\htdocs\'); define ('BASE_URL', 'http://localhost/');