wampserver set up
Posted by: bvaz (---.client.mchsi.com)
Date: June 15, 2017 03:05AM

A newbie to wampserver....I am writing html and php code using dreamweaver. The html code executes fine in local host environment. However, the simplest of php code will not run. A simple echo statement does not execute. Is there a change I must make to the config files. I am lost. Any help appreciated.

Options: ReplyQuote
Re: wampserver set up
Posted by: RiggsFolly (Moderator)
Date: June 15, 2017 12:53PM

Hi

Vanilla PHP code should run right out of the box.


Are you sure that you are running your site from the browser directly, and NOT clicking on a filename in Explorer?

---------------------------------------------------------------------------------------------
(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: wampserver set up
Posted by: bvaz (---.client.mchsi.com)
Date: June 15, 2017 09:39PM

I create the code and save it in wamp64/www/mysite/program.html. I then go to the directory and click on the file name. this works for html files only but not with those having php code. Is there another way?

Options: ReplyQuote
Re: wampserver set up
Posted by: RiggsFolly (Moderator)
Date: June 15, 2017 09:46PM

Well you have a couple of issues here.

1. PHP code will not run in a file with the extension.html, it must be a .php extension

2. PHP code will not run if you click the fil ein explorer, html code will work that way, and javascript will work, BUT NO PHP

PHP Need the Apache web server.

So

1. change the extension to .php
2. in your browser enter `localhost/mysite/program.php` and it will work.

---------------------------------------------------------------------------------------------
(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: wampserver set up
Posted by: bvaz (---.client.mchsi.com)
Date: June 16, 2017 03:08PM

Riggs,
Thank you very much that works. However, I go to the wampserver (green logo), select local host and enter same , but the error "critical error, no domain selected" How do I correct that?

Options: ReplyQuote
Re: wampserver set up
Posted by: RiggsFolly (Moderator)
Date: June 16, 2017 03:46PM

Hi

Did you amend your HOSTS file?

C:\windows\system32\drivers\etc\hosts

It should contain

127.0.0.1 localhost
::1 localhost

Without any `'` comment markers in front of those 2 lines

---------------------------------------------------------------------------------------------
(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: wampserver set up
Posted by: bvaz (---.client.mchsi.com)
Date: June 19, 2017 04:56PM

I amended the host file -- the above lines were prefaced with '#" and removed them. I still received the no domain error. The host files has this line below it -- 127.0.0.1 localhost127.0.0.1 localhost -- shoud it be commented out?
This is the way it looks:
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost

127.0.0.1 localhost127.0.0.1 localhost

Options: ReplyQuote
Re: wampserver set up
Posted by: RiggsFolly (Moderator)
Date: June 19, 2017 05:38PM

Yes remove the last line

---------------------------------------------------------------------------------------------
(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: wampserver set up
Posted by: bvaz (---.client.mchsi.com)
Date: June 19, 2017 09:10PM

I guess I am really an idiot! Following is current host file:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost

#127.0.0.1 localhost127.0.0.1 localhost

I restarted all wamserver services selected local host, selected my project, and still get this erro:
Critical error: no domain selected!
Sorry to be a bother, but I am lost....and yes, ignorant.

Options: ReplyQuote
Re: wampserver set up
Posted by: RiggsFolly (Moderator)
Date: June 19, 2017 09:17PM

Change the hosts file to be

127.0.0.1 localhost
::1 localhost

And nothing else

---------------------------------------------------------------------------------------------
(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: wampserver set up
Posted by: bvaz (---.client.mchsi.com)
Date: June 21, 2017 04:09AM

Riggs,
All of the suggestions have failed. I have downloaded and installed anew wampserver. It is currently sitting in vanilla state (no changes). Is there a tutorial that explains what changes to what files must be made and tutorial to explain how passwords and user names for php, apache, and sql should be made? Thank you for your help.
Bob

Options: ReplyQuote
Re: wampserver set up
Posted by: RiggsFolly (Moderator)
Date: June 21, 2017 11:33AM

Hi

All you need to check after install is that the HOST file looks like I suggested in above answer.

Other than that, assuming you have all the required MSVC Runtime installed it just works.
Remember, if you have a 64bit windows, and installed a 64bit WAMPServer, you need to install the MSVC Runtimes for BOTH 32bit and 64bit systems.


As to tutorials, if you check my signature block, you will seee links to all the relevant manuals for Apache/MySQL/PHP/phpMyAdmin.

They all work as per the standard manuals, so we do not attempt to re-invent the wheel in any way.

---------------------------------------------------------------------------------------------
(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: wampserver set up
Posted by: bvaz (---.client.mchsi.com)
Date: June 23, 2017 02:24AM

Riggs,
Everything is working, sort of.....I think I have isolated the issue.
Selecting local host from wampserver icon, i enter program name and it executes.
Selecting local host from wampserver icon, i enter new folder/program name it executes.
Selecting local host from wampserver, then select the folder in "your Projects" then enter program name, it gives me the 'critical error' message. if i then type subfolder/program name is works.
It seems that what is supposed to happen when selecting "your projects" , the sub folder should be inserted somewhere to look in that folder for the program, possibly the hosts file? Does this sound plausible, or am I barking up the wrong tree?
Thanks

Options: ReplyQuote
Re: wampserver set up
Posted by: RiggsFolly (Moderator)
Date: June 23, 2017 12:15PM

Ok, this is what I think you need to read now.

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: wampserver set up
Posted by: bvaz (---.client.mchsi.com)
Date: June 23, 2017 06:55PM

Great! Having issue with this statement in "create or add virtual host"
We arrive on the Add Virtualhost page in which it is required to validate the VirtualHost submenu, then:
- Right-Click Wampserver Icon -> Wamp Parameters -> VirtualHosts submenu
Have right clicked every wampserver icon and do not get the parameters option.

Options: ReplyQuote


Sorry, only registered users may post in this forum.