Jump to content

Testing on WAMP


Recommended Posts

Hi, I've written a CMS, works fine on my Linux dev OS. I've just setup WAMP on a Win machine and it's complaining at this:

 

 

<?php
define('NUBBASE', 'http://localhost/cms/site/');
define('NUBDIR', 'C:\wamp\www\cms\site\');

function rx_settings(){
    return array ('sitename' => 'mysite.co.uk',
  'sitetag' => 'Developing minds...',
  'db_host' => 'localhost',
  'db_uname' => 'testuser',
  'db_pass' => 't3st3rspasSw0rd',
  'db_dbname' => 'dbtest',
  'db_prefix' => 'nub_',
  'sitesalt' => 'rxWhsqSkWk'
);
}
?>

 

Thisis the error I'm getting:

 

Parse error: syntax error, unexpected 'sitename' (T_STRING) in C:\wamp\www\cms\site\nub\config.php on line 6

 

Line 6 is the line with "sitename" on.

I've tried swapping the quotes, gone through and replaced all line endings.

 

What's going wrong here? Any other things I could expect?

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/295688-testing-on-wamp/
Share on other sites

lol, makes perfect sense, doh!

 

However, that path is generated by __DIR__:

 

$ndir=rtrim(__DIR__,"nub");

 

On searching i'm not seeing this issue mentioned... or output showing similar either???

 

Yes, Ican replace these manually, issue solved. However is this the expected behaviour of __DIR__ or ...?

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/295688-testing-on-wamp/#findComment-1509394
Share on other sites

So...

 

$ndir=str_replace('\\','/',rtrim(__DIR__,"nub"));    //    Pre PHP 5.3 use dirname(__FILE__) instead of __DIR__

Since Windows handles both path types, whereas Linux doesn't. This way the config file can be transferred easily without re-install!

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/295688-testing-on-wamp/#findComment-1509397
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.