Jump to content

Testing on WAMP


Go to solution Solved by blacknight,

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.