1 Reply Latest reply on Feb 3, 2010 7:55 PM by Symphony Photo

    Local testing server with user account on OS X with PHP?

    Symphony Photo

      Hi,

       

      New to Dreamweaver and I'm having a bit of a problem getting a test server going with PHP. I suspect this is NOT a Dreamweaver problem but something to do with OS X (actually it's something to do with me not understanding something).

       

      Here's what I know... Apache is running, PHP is enabled (you can call phpinfo() etc. no problems). That's all good. I'm not logged in as the administrator, I have a regular user account which I use to do just about everything that doesn't require an administrative account. So... the path to the test server should be:

       

      /Users/username/Sites

       

      and the host would be:

       

      http://localhost/~username

       

      Now, when I'm working with a straight ahead html document and I test the site by selecting test using Safari or test using Firefox it works just fine. If however I use the php version of the website it will only load the first page accurately, subsequent calls render the URL to http://localhost/ as the root and not http://localhost/~username as should be the case. I'm pretty sure it's not my code as I've uploaded this to the actual server it will eventually run on and it works just fine.

       

      Let me give a bit more detail. Let's say I have the following structure:

       

      /index.php

      /menu.php

      /contact.php

      /location.php

       

      That's all on the root level. I have two sub folders.... I'll call them one and two and inside each sub folder are pages that have serveral topics so...

       

      /one

      /two

       

      Inside one is:

       

      /one/topic1.php

      /one/topic2.php

      /one/topic3.php

       

      Inside two is:

       

      /two/topic1.php

      /two/topic2.php

      /two/topic3.php

       

      Every page uses the same navigation bar which is included in menu.php and it's called from all of the pages using include( "menu.php" );  My menu.php file references all the paths from the root level of the website. I think this is what's tripping things up... in other words let's say I'm looking at /two/topic2.php and I want to go to the contact page. The href link is to /contact.php. At that point what gets called is:

       

      http://localhost/contact.php

       

      I want the "root" to be http://localhost/username otherwise it requires me to login as an admin to do the testing or give permissions to /Library/WebServer/Documents, neither of which I want to do.

       

      I thought that by going into manage sites, selecting "testing server" and entering http://localhost/~username would tell Dreamweaver that ~username is the root for the purpose of testing but... that's not how it's working out.

       

      Any advice as to what I should be doing to get around this?

       

      Cheers, Joe