Launch Wampserver without admin right
Posted by: Kelfka (---.ieregionqc.ca)
Date: March 10, 2016 02:55PM

I have the same problem. The method above worked, but I absolutely need for it to work without running it with admin rights. So a normal user can run it.
I there a way to make it work?
Also I've noticed that every time I start Wampmanager without admin rights it deletes all symlink files in C:\wamp\bin\apache\apache2.4.17\bin including the php.ini link.
Is that normal?

Thanks



Edited 1 time(s). Last edit at 03/10/2016 03:10PM by Otomatic.

Options: ReplyQuote
Re: Launch Wampserver without admin right
Posted by: Otomatic (Moderator)
Date: March 10, 2016 03:15PM

Hi,

> I absolutely need for it to work without running it with admin rights
To start services without admin rights, use "setACL"
See : [forum.wampserver.com]

The shortcut that launch Wampserver MUST have "run as administrator" checked, otherwise, symlinks cannot be created.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Launch Wampserver without admin right
Posted by: Kelfka (---.ieregionqc.ca)
Date: March 10, 2016 03:31PM

Thanks for the quick answer!
I've indeed used "setACL" for the services. That was my first problem.
But the PHP link error is still there.
At install the php.ini symlink was created.
On first run as admin about 15 other symlink files are created in C:\wamp\bin\apache\apache2.4.17\bin
But if I run it without admin all symlink files get deleted and php doesn't work.

BTW
1 - Windows 8.1 64 bit
2 - Version WampServer 3.0.0 32 bit
3 - Apache Version 2.4.17
4 - PHP Version 5.6.15
5 - MySQL Version 5.5
6 - What color is the WampServer icon (Green)

Edit: what I meant was that: If I start wampmanager without admin "after" all the symlink files are created, the files get deleted.



Edited 1 time(s). Last edit at 03/10/2016 03:55PM by Kelfka.

Options: ReplyQuote
Re: Launch Wampserver without admin right
Posted by: Otomatic (Moderator)
Date: March 10, 2016 04:40PM

Hi,

> At install the php.ini symlink was created.
It is created by Inno Setup installer.

> On first run as admin about 15 other symlink files are created in C:\wamp\bin\apache\apache2.4.17\bin
Each time Wampmanager is launched, all symlinks are deleted then created to reflect correct Apache and PHP version in use.

You can try to see if it works by copying the files whitout admin rights instead of creating symbolic links.

In the wamp\scripts\wampserver.lib.php file
Replace :
		//Symlink created if file exists in phpx.y.z directory
		if (is_file($target)) {
			symlink($target, $link);
		}
	}
	//Create apache/apachex.y.z/bin/php.ini link to phpForApache.ini file of active version of PHP
	$target = $c_phpVersionDir."/php".$php_version."/".$phpConfFileForApache;
	$link = $c_apacheVersionDir."/apache".$wampConf['apacheVersion']."/".$wampConf['apacheExeDir']."/php.ini";
	//php.ini deleted if exists
	if(is_file($link) || is_link($link)) {
		unlink($link);
	}
	if(symlink($target, $link) === false)
		error_log("Error while creating symlink '".$link."' to '".$target."'"winking smiley;
}
by
		//Symlink created if file exists in phpx.y.z directory
		if (is_file($target)) {
			copy($target, $link);
		}
	}
	//Create apache/apachex.y.z/bin/php.ini link to phpForApache.ini file of active version of PHP
	$target = $c_phpVersionDir."/php".$php_version."/".$phpConfFileForApache;
	$link = $c_apacheVersionDir."/apache".$wampConf['apacheVersion']."/".$wampConf['apacheExeDir']."/php.ini";
	//php.ini deleted if exists
	if(is_file($link) || is_link($link)) {
		unlink($link);
	}
	if(copy($target, $link) === false)
		error_log("Error while creating symlink '".$link."' to '".$target."'"winking smiley;
}
BUT.... WARNING All changes you make in php.ini (Wampmanager Tray Icon -> PHP -> php.ini that is wamp\bin\apache\apache2.4.17\bin\php.ini) ABSOLUTELY MUST be redone in wamp\bin\php\phpx.y.z\phpForApache.ini. x.y.z being active PHP release.
This is done automatically with symlinks.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Launch Wampserver without admin right
Posted by: Kelfka (---.ieregionqc.ca)
Date: March 11, 2016 03:51PM

Thanks, but it look like I don't have the same exact code you shone above.
And when I tried t replace it, nothing worked afterwards.
But I did find a work around.

I've put in comment the if that deletes the php.ini file if it exists.
Indicated with: ==>
And it looks like it worked


if (is_file($target)) {
symlink($target, $link);
}
}
//Create apache/apachex.y.z/bin/php.ini link to phpForApache.ini file of active version of PHP
$target = $c_phpVersionDir."/php".$php_version."/".$phpConfFileForApache;
$link = $c_apacheVersionDir."/apache".$wampConf['apacheVersion']."/".$wampConf['apacheExeDir']."/php.ini";
==> //if(is_file($link) || is_link($link)) {
==> // unlink($link);
==> //}
symlink($target, $link);
}

Thanks again for the help.
Now I wont have to give my admin password to 20 students.
Thanks!

Options: ReplyQuote
Re: Launch Wampserver without admin right
Posted by: Otomatic (Moderator)
Date: March 11, 2016 04:44PM

Hi,

> Thanks, but it look like I don't have the same exact code you shone above.
You have 3.0.0 and I give code for 3.0.4.

But you only have to replace symlink($target, $link) by copy($target, $link) two times.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.