ken Posted January 17, 2014 Share Posted January 17, 2014 I am trying to install the ex1 example on my computer but I have problem setting the working directories in the configuration file. Can somebody help? Thanks in advance! Ken Link to comment Share on other sites More sharing options...
Larry Posted January 17, 2014 Share Posted January 17, 2014 Sure thing, Ken. How about providing us with some information as to how your system is setup? Like the folders and URLs you'd be using? Link to comment Share on other sites More sharing options...
ken Posted January 17, 2014 Author Share Posted January 17, 2014 Thanks Larry for that fast answer. I am working in windows environment. Apache was installed with WAMP. So my setting are as follow: Root directory: " c:\wamp\www\ecom1". I set the configuration file like this: define('BASE_URI', 'C:\wamp\www\ecom1'); define('BASE_URL', 'localhost/ecom1/'); define('PDFS_DIR', BASE_URI . 'includes/pdfs'); define('MYSQL', BASE_URI . 'mysql.inc.php'); I copied all the downloaded files in the root directory (C:\wamp\www\ecom1) and moved the pdf directory and the mysql.inc.php file in the includes directory. When I launch the application from the browser with the address : http://localhost/ecom1, I got a blank page. Link to comment Share on other sites More sharing options...
Necuima Posted March 21, 2014 Share Posted March 21, 2014 Hi Ken, I am not familiar with wamp but have xampp on my development PC. My understanding is that when you key in http://localhost/ecom1 the browser looks for either index.html or index.php within the ecom1 directory. I wonder if the problem is the absence of either of these? Cheers. Link to comment Share on other sites More sharing options...
laurent vignaux Posted March 22, 2014 Share Posted March 22, 2014 Hello Ken, if you follow the book, all your pages are in folder "html" so perhaps you must do that for BASE_URL /ecom (mysqli.inc.php ) -> /html ( /includes(config.inc.php, etc…) , pages.php, etc…) define('BASE_URI', 'C:\wamp\www\ecom1'); define('BASE_URL', 'localhost/ecom1/'); <----- http://localhost/ecom1/html/ define('PDFS_DIR', BASE_URI . 'includes/pdfs'); define('MYSQL', BASE_URI . 'mysql.inc.php'); i work on mac with MAMP and it's fine : ( define('BASE_URI', '/Applications/Mamp/htdocs/ecom1/'); define('BASE_URL', 'http://localhost:8888/ecom1/html/'); define('MYSQL', BASE_URI.'/mysql.inc.php'); cordialy 1 Link to comment Share on other sites More sharing options...
Ardian Posted May 31, 2014 Share Posted May 31, 2014 Hi Larry I want to thankyou about this great book I bought it in amazon I am glad for, it is worth it. Wish you the Best I put the file of the EX2 in the html but need help at the configuration file : I am facing some problem this is for testing in localhost than I am going to put in my hosting domain maybe I am gonna need a little bit more help : Problem: Parse error: syntax error, unexpected 'BASE_URL' (T_STRING) in C:\xampp\htdocs\ex2\html\includes\config.inc.php on line 38 // Determine location of files and the URL of the site: define('BASE_URI', 'C:\xampp\htdocs\ex2\html\'); define('BASE_URL', 'http://localhost/ex2/html/'); -------------" LINE 38 " define('MYSQL', BASE_URI . 'mysql.inc.php'); What should I change here ? // Set the database access information as constants: DEFINE ('DB_USER', 'root'); DEFINE ('DB_PASSWORD', 'password'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'ecommerce2'); // Make the connection: $dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // Set the character set: mysqli_set_charset($dbc, 'utf8'); Link to comment Share on other sites More sharing options...
Larry Posted May 31, 2014 Share Posted May 31, 2014 Thanks for the nice words. I appreciate it. I don't see an obvious parse error on that line. Are you sure this is the right script/code? In any case, this is just a general parse error due to invalid syntax. If your text editor or IDE has syntax highlighting, it should help point out where the problem starts. Link to comment Share on other sites More sharing options...
Recommended Posts