NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Mapping with wampserver and pear includes


Joined: 10 May 2006
Posts: 6
Reply with quote
Hello Very Happy

I have just downloaded the evaluation version (4.5.1) of this amazing product, and am very interested at integrating into my current set-up.

I have a couple of problems relating (i think) to the same mapping issue. Let me first explain my set-up:
I have winXP (sp2) running wampserver running php4. I have installed wamp at c:\wamp, and i believe my web root is c:\wamp\www. Within c:\wamp\www i have folders containing my projects, such as c:\wamp\www\SiteA. Running the url http://localhost/SiteA will execute the index.php at c:\wamp\www\SiteA.

So i've created a new workspace, a new project, and saved all the project files at c:\wamp\www\Discovery. I've set the run mode to 3rd party web server (the wamp installation of apache). I've also pointed phpEd to my wamp installations of php (by setting the path in tools->settings->tools->srv webserver - Type: php4: C:\wamp\php4\php.exe). I have installed the debugger dll and that works fine.

My project properties are as follows:

  • Properties

    • Project: C:\wamp\www\Discovery\project1.ppj
    • Root Directory: C:\wamp\www\Discovery
    • Root URL: http://localhost/Discovery
    • Remote Root Directory: C:\wamp\www\Discovery

  • Mapping

    • Remote Directory: c:\wamp\www\Discovery
    • Local Directory: c:\wamp\www\Discovery
    • URL: http://localhost/Discovery



First of all, i am trying to create a "private" area for each project, so in the above Discovery example, i'd have c:\wamp\www\Discovery\www, where the latter www folder would contain the "viewable" pages, and the c:\wamp\www\Discovery can contain config files or folders. So from what i understand, i somehow need to map http://localhost/Discovery to this c:\wamp\www\Discovery\www. What settings do i need to change to be able to do this?

However, if i do this, will this only work when viewing the site through phpEd? For instance, at the moment, i can view any of my sites by either typing into the browser, or start menu->run "http://localhost/Discovery/", which will serve up the index page in that directory. If i create this "private" directory structure, will i have to type "http://localhost/Discovery/www/" to view it from outside of phpEd?

My second issue relating to mapping is regarding pear. My pear installation is at c:\wamp\php4\pear. Yet i noticed that when i view the Includes tab in project properties, it says:


  • Source file: index.php | Include Statement: include_once("Savant2.php") | Resolved Filename: c:\wamp\www\Discovery\Savant2.php
  • Source file: index.php | Include Statement: include_once("HTML/Quickform.php") | Resolved Filename: c:\wamp\www\Discovery\HTML\Quickform


Now the resolved filenames don't exist. Furthermore, when i select an include, and manually select the correct path, the text changes to yellow, and it doesn't update the path. When i run the project through the debugger, stepping over each line with F8, the debugger makes no mention of "unable to map to remote file / local file" that i've seen other people have trouble with. I also understand that setting the correct include path will allow code-completion of the included files functions.

Does the pear path need mapping too? I tried adding the mapping tab a local and remote path of c:\wamp\php4\pear, but that seemed to make no difference, so i removed it.

Any help would be greatly appreciated, thanks for reading this far Smile
View user's profileFind all posts by boboboSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
If I understand you correctly, you need http://localhost/ site to work with directory tree starting with C:\wamp\www\Discovery\www and have project root one level upper. In this case project properties must be per following:

Project root directory -> C:\wamp\www\Discovery
Remote root directory -> C:\wamp\www\Discovery
Root URL should be empty
then add one additional mapping entry on the Mappings tab and set it per following:
Local directory -> C:\wamp\www\Discovery\www
Remote directory -> C:\wamp\www\Discovery\www
Root URL -> http://localhost/

Don't forget to set Web root directory in the web server settings to point to C:\wamp\www\Discovery\www

If you need multiple sites, I'd recommend you to add as many host names as you wish to C:\Windows\system32\drivers\etc\hosts
like below:
127.0.0.1 localhost host1 host2 host3
then add virtual hosts to apache configuration and access hosts by their names (update URLs in the mapping):
http://host1/
http://host2/
http://host3/
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 May 2006
Posts: 6
Reply with quote
Thanks for your detailed reply.

I made all the changes you specified, but when i go to run the project now, i get an error message:
Quote:

Failed to run URL in an external browser.
Please check if there is a default HTML browser installed on your system.
Error code=2


So let me just re-iterate my updated project properties:


  • Properties

    • Root Directory: C:\wamp\www\Discovery
    • Remote Directory: C:\wamp\www\Discovery
    • Root URL: <empty>

  • Mapping (i now have two entries)

    • 1. Remote: c:\wamp\www\Discovery | Local: c:\wamp\www\Discovery | URL: <empty>
    • 2. Remote: c:\wamp\www\Discovery\www | Local: c:\wamp\www\Discovery\www | URL: http://localhost



Quote:
Don't forget to set Web root directory in the web server settings to point to C:\wamp\www\Discovery\www

If i got this right, then under tools->settings->tools->srv web server, i added an entry under Server Mappings, so it now has 1 entry that reads:

  • URL: localhost
  • Path: c:\wamp\www\Discovery\www


Is there a parameter missing, or which one have i filled out incorrectly?
Thanks.
View user's profileFind all posts by boboboSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
2. Remote: c:\wamp\www\Discovery\www | Local: c:\wamp\www\Discovery\www | URL: http://localhost

this mapping entry "means" that Web server (whatever behind http://localhost) serves c:\wamp\www\Discovery\www as document root. Please check if it is set to this value in the web server configuration. If for example you run Apache, it's httpd.conf to look at.

Quote:
Failed to run URL in an external browser

What default browser is in your system?
If it is netscape navigator or opera, you have to use embedded browser only. Just uncheck "run in external browser" checkbox.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 May 2006
Posts: 6
Reply with quote
Thanks for your reply.

In my http.conf file, my server root is c:/wamp/apache, and the document root is c:/wamp/www. I have no virtual hosts defined, which i think is causing the problem, and am not sure how to proceed: do i add a new entry (<VirutalHost:*80></VirtualHost>)? I found this at the bottom of the file:
Quote:
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.myserver
# DocumentRoot /www/docs/dummy-host.myserver
# ServerName dummy-host.myserver
# ErrorLog logs/dummy-host.myserver-error_log
# CustomLog logs/dummy-host.myserver-access_log common
#</VirtualHost>


Do i need to create one of these for each project i have, filling out the appropriate document root for each one?


My C:\Windows\system32\drivers\etc\hosts file has a single line:
127.0.0.1 localhost Discovery


As for the error, IE is my default browser. When i uncheck the "run in external browser" box, then run the project, a new tab appears within the editor but its a 404 (page can't be displayed). But this has only happened since i changed the project properties to the ones stated in the 2nd post: so i think its safe to assume its not so much an error but more where i've haven't configured the project properly.

Will these new settings also solve the problem with the PEAR include path?

Thanks.
View user's profileFind all posts by boboboSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
Do i need to create one of these for each project i have, filling out the appropriate document root for each one?

IMHO it's a very convenient way.

Quote:
My C:\Windows\system32\drivers\etc\hosts file has a single line:
127.0.0.1 localhost Discovery

so there are two names associated with 127.0.0.1 - they are localhost and Discovery. Feel free to add more Smile


Quote:
When i uncheck the "run in external browser" box, then run the project, a new tab appears within the editor but its a 404 (page can't be displayed).


Check web server logs (both access.log and error.log) to see what URL was requested and why it returned 404 (file not found)
Probably you did not put the file in the document root.

Quote:
Will these new settings also solve the problem with the PEAR include path?

No. These settings will let you work with multiple projects under the same physical web server.
Pear's include should be added to the projects mapping table.
If for example path to pear is c:\mydir\pear, just add the following mapping line:
local path->c:\mydir\pear
remote path->c:\mydir\pear
and you'll be all set.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 May 2006
Posts: 6
Reply with quote
Very Happy

Great, i've got it configured just how i want it. The 404 was due to misconfiguration of the document root.

I'd never known about virtual hosts before, and if you don't mind, i'd like to add a url to a very simple tutorial to virtual hosts for anyone in a similar pickle as me: www.apptools.com/phptools/virtualhost (feel free to delete the link otherwise).

As far as the pear problem goes, i'd added the path to the includes tab, but wasn't getting the auto-complete. All i had to do was add the pear path to the Code Insight Includes at the bottom of project properites Rolling Eyes .

Now i have to give a compliment. I've tried several IDE's/ editors the past few weeks, and the top two seem to be this and zend. What seperates phpEd from the Zend IDE is the excellent level of support you get: detailed, full-explanations into the nature of your problem. The level of support you get is equal to the quality of the product: excellent Very Happy

Many thanks for your time.
Cool
View user's profileFind all posts by boboboSend private message
Mapping with wampserver and pear includes
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic