Unable to open WampServer's config file
Posted by: funkyfrank (---.eu)
Date: October 16, 2014 02:06PM

Version of Operating system? Windows Ultimate 7 64bit
Version of Wamp Server installed? 2.5 32bit
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12

What colour is your WampManager icon? Green

Host file localhost 127.0.0.1


Hello All & Greetings, this is my first post smiling smiley


I am using Aptana as my IDE. To be able to preview PHP projects from my usual workspace I did change the DocumentRoot in httpd.conf to "D:/WEB WORK/Aptana Workspace/" as well as <Directory "D:/WEB WORK/Aptana Workspace/">.

This enables my to keep my Aptana workspace as is and I can preview the projects inside Aptana as well as in browsers from URL /localhost/{here is my project name}/

So this is working all fine.


However when I now simply go to /localhost/ in the browser I get the error "Unable to open WampServer's config file, please change path in index.php file".

I looked inside the index.php file residing on c:/wamp/www/ and found this.

$server_dir = "../";
//Fonctionne à condition d'avoir ServerSignature On et ServerTokens Full dans httpd.conf
$server_software = $_SERVER['SERVER_SOFTWARE'];

$wampConfFile = $server_dir.'wampmanager.conf';
//chemin jusqu'aux fichiers alias
$aliasDir = $server_dir.'alias/';

// on charge le fichier de conf locale
if (!is_file($wampConfFile))
die ('Unable to open WampServer\'s config file, please change path in index.php file');
$fp = fopen($wampConfFile,'r');
$wampConfFileContents = fread ($fp, filesize ($wampConfFile));
fclose ($fp);

I think I need to change the line $wampConfFile = $server_dir.'wampmanager.conf'; but I do not know to what I should change it.

I only changed the Document Root and nothing else in the http.conf file. Do I need to change that line to the new Document Root as well?

Note that /localhost/phpmyadmin/ is working just fine. I can see the phpmyadmin panel perfectly.

The only thing missing is to link the wampmanager.conf to the correct path but I would not know to where since the server root did not change only the document root.

Please note these are my first 30 minutes with WAMP so please forgive any obvious mistakes. Would be very happy to get that neat localhost menu back that was there before I changed the Document Root to be my Aptana Workspace.

Thanks for any help.

Best
Frank



Edited 3 time(s). Last edit at 10/16/2014 03:05PM by funkyfrank.

Options: ReplyQuote
Re: Unable to open WampServer's config file
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: October 17, 2014 11:22AM

If you are going to play with the basic wamp setup and config then you are basically on your own.

A better solution would be to leave the WAMPServer alone and setup a Virtual Host for your project and then configure your project in Aptana to launch 'http://project/index.php'

This is how I do it using NetBeans and it works just great! You can point a Virtyal Hosts's DocumentRoot to any folder basically, so that solves your situation where you have your site code in a folder outside the Wamp Folder structure.

See this document on how to setup Virtual Hosts, or the Apache documentation.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Unable to open WampServer's config file
Posted by: funkyfrank (---.eu)
Date: October 17, 2014 11:36AM

Thank you for your reply. Happy to hear from you!

Does that mean that every new project I create I need a new Virtual Host or does one Virtual Host suffice for all the projects I have at the moment?

Asking since sometimes I just test projects downloads, like frameworks or plugins and if I don't like them I just chuck them and setting up a virtual host just for a short test run of a couple minutes would be some extra work to do.

Though I am not saying at all that extra work is something I don't like to do. If this is the PRO approach to doing things I might as well get used to it, especially for larger things like coding WP templates etc. Am I right here?

Just saying the way I have it now I can quickly create any new project with Aptana and run it either on 127.0.01 or on the WAMP localhost and it works out of the box without extra work, if I don't like it I remove it and done.

Perhaps there is a WAMP script or plugin to create virtual hosts for new projects?

Best
Frank

Options: ReplyQuote
Re: Unable to open WampServer's config file
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: October 17, 2014 12:37PM

There is nothing to stop you creating sub folders to the \wamp\www folder for quick and dirty testing of odd things, but, especially for WP and CMS's a Virtual Host solves so many potential issues, before they become apparant, it is a good thing to be familiar with.

Yes, you need one VH and one addition to the \windows\system\drivers\etc\hosts file per project really, although I have a VH called 'testing' that I just throw things at like you do when I am looking at something new or playing.

Once you have a couple of VH's setup its really just a copy/paste/change a couple of folder and a domain name to create a new one. 5 mins at the most.

There is not 'Create me a Virtual Host' script, but have a look at this post to help you get started. It also tries to infom as to why they are such a good idea. I hope it helps. WAMPServer 2.5 The Homepage, Your Projects Menu and the need for Virtual Hosts

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Unable to open WampServer's config file
Posted by: funkyfrank (---.178.139.19.46.swissinet.com)
Date: October 18, 2014 03:10PM

Riggs, I will take a good look at those and I am sure I will get the hang of making VHs soon.

You are right, for starting with HTML5, CSS3 mixed with PHP for forms etc dumping things in www is fine but I am sure for WP etc VHs are surly needed.

Thank you for your help!

Regards
Frank

Options: ReplyQuote
Re: Unable to open WampServer's config file
Posted by: lem (---.72.70.115.static.exetel.com.au)
Date: October 30, 2014 05:59PM

If, like me you copied the index.php file from the default folder to say: f:/www/
The folowing changes are needed to index.php

// original
// $server_dir = "../";
// New, with files at eg: f:/www
$server_dir = "";

//Fonctionne à condition d'avoir ServerSignature On et ServerTokens Full dans httpd.conf
$server_software = $_SERVER['SERVER_SOFTWARE'];

// original
// $wampConfFile = $server_dir.'wampmanager.conf';
// New, with files at eg: f:/www
$wampConfFile = $server_dir.'c:/wamp/wampmanager.conf';

//chemin jusqu'aux fichiers alias
// original
// $aliasDir = $server_dir.'alias/';
// New, with files at eg: f:/www
$aliasDir = $server_dir.'c:/wamp/alias/';

Options: ReplyQuote
Re: Unable to open WampServer's config file
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: October 31, 2014 10:10AM

If you want to move your site code to another location away from the \wamp.... folder structure. The best way is to use Virtual Hosts.

See here for help WAMPServer 2.5 The Homepage, Your Projects Menu and the need for Virtual Hosts

Its not just relevant to WampServer 2.5 it works in all versions and should be required knowledge for all developers using Apache.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Unable to open WampServer's config file
Posted by: funkyfrank (---.234.27.17.81.swissinet.com)
Date: November 11, 2014 09:23AM

Lem and Riggs

Thank you for your reply. I did not go through with trying out your suggestion since I followed the VirtualHosts route and am now comfortable with it.

In the beginning I thought this is not nice to do and so on but now I am so happy doing that and it really only takes very little time plus I get the URL to look what it will like on the live server, so really making the whole preview quite good.

Thank you both for your help here.

Regards
Frank

Version of Operating system? Windows 7 Ultimate 64bit
Version of Wamp Server installed? 2.5 32bit
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12
What colour is your WampManager icon? Green
Host file localhost 127.0.0.1

New to WAMP?
Read this please: [forum.wampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.