Changing editor on install causes problems
Posted by: asajay (---.hfc.comcastbusiness.net)
Date: August 15, 2016 06:44AM

I have installed WampServer v3.0.4 multiple times and during the install I change the default text editor and the default browser. Each time I do this, the install finishes and all appears well, except that trying to use the editor fails badly.

System specifications:
- Windows 7 Pro, SP1, 64-bit
- All Prerequisites are satisfied (all MS Visual C++ 2008 through 2015, both x86 and x64 versions and all updates)
- Install file used: wampserver3.0.4_x86_apache2.4.18_mysql5.7.11_php5.6.19-7.0.4
- Install run as right-click "run as administrator"
- Do I wish to change the default browser, Yes; then I select Chrome
- Do I wish to change the default editor, Yes; then I select an alternate at C:\UEDIT32\uedit32.exe

Install finishes and I manually start WampServer; it goes green within a few seconds.
Left-click Wamp icon, select PHP > php.ini
The editor opens, opens a file and then immediately tries to print the file and closes.
I eventually had to disable printing so the process would stop and I could look at what was happening.
The editor appears to open just fine, but the file it points to does not exist.

Example:
The file should be at C:\wamp\bin\apache\apache2.4.18\bin\php.ini
The file indicated in the editor is C:\wampinampapacheapache2.4.18inphp.ini

As you can see, the path is being messed up quite badly.

If however, I install and allow the defaults to be selected (IE and notepad), then it works fine. I left-click on the Wamp icon, PHP > php.ini and the file opens in Notepad.

HOWEVER, I can't figure out where that file is; because it's NOT in the C:\wamp directory structure anywhere. There are only three listings for php.ini in the entirety of the C:\wamp folders. One is a symlink to apparently nowhere (I presume this is what is being started from the wamp menu). The other two reside in the C:\wamp\bin\php directories themselves, and are clearly marked as DO NOT EDIT; whereas the one opened from the menu is clearly the one to edit.

Therefore, two questions:
Why is selecting an alternate editor failing?
Where is the actual php.ini file that is being edited by Notepad?

Thank you,
Asa Jay

Re: Changing editor on install causes problems
Posted by: asajay (---.hfc.comcastbusiness.net)
Date: August 15, 2016 06:58AM

I have figured out which php.ini file is being opened when I left-click on the Wamp icon and select PHP > php.ini


It opens the following file:
C:\wamp\bin\php\php5.6.19\phpForApache.ini

Still to be answered, why does selecting a different editor on install -not- work?

Re: Changing editor on install causes problems
Posted by: asajay (---.hfc.comcastbusiness.net)
Date: August 15, 2016 07:22AM

And a follow up.

Why does the file C:\wamp\wampmanager.ini get overwritten each time wampmanager starts?

I can see there are pointers to the editor in that file, but when I manually change and save them, they are all "reset" to the defaults used on install when I start wampmanager again. Where are those defaults being stored?

Re: Changing editor on install causes problems
Posted by: Otomatic (Moderator)
Date: August 15, 2016 09:35AM

Hi,

> Why does the file C:\wamp\wampmanager.ini get overwritten each time wampmanager starts?

Because that's what works Wampserver.
wampmanager.ini is recreated every time Wampserver is launched and every time a parameter is changed (Apache, PHP, MySQL).And it depends on many parameters, such as any of these parameters can be changed, it is essential to recreate wampmanager.ini.

If you want to change text editor, see the file wamp/wampmanager.conf and principaly:
;Path of the Text Editor used by Wampserver
;May be modfied with the absolute path of the Text Editor exe file
;(Use / instead of \)
editor ="notepad.exe"
I use
editor ="J:/Util/Texte/Notepad++/notepad++.exe"
or
editor ="J:/Util/Texte/Ultraedit/uedit64.exe"
without any problem.

After modifying a Wampserver parameter, you must restart Wampserver.

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

Re: Changing editor on install causes problems
Posted by: asajay (---.hfc.comcastbusiness.net)
Date: August 15, 2016 03:47PM

Thank you,
This still does not explain why UltraEdit can't seem to open the file; why the filename and path are badly parsed when trying to open. Would a screenshot help? I can do that when I get home from work tonight.

Asa Jay

Re: Changing editor on install causes problems
Posted by: RiggsFolly (Moderator)
Date: August 15, 2016 04:20PM

Hi,

You did notice the use of FORWARD SLASHES and not the normal DOS Back Slash didnt you?

As this parameter is in a double quoted string using a single dos backslash is treated as an escape character and will cause you problems.

It being used by a PHP script remember!

---------------------------------------------------------------------------------------------
(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-

Re: Changing editor on install causes problems
Posted by: Otomatic (Moderator)
Date: August 15, 2016 04:28PM

Hi,

> Left-click Wamp icon, select PHP > php.ini
> The editor opens, opens a file and then immediately tries to print the file and closes.
> This still does not explain why UltraEdit can't seem to open the file;
> why the filename and path are badly parsed when trying to open.

Sometimes symbolic link php.ini that point to the file phpForApache.ini is badly created by the installation and the installer can not verify it.

This is indicated by an error message at the bottom of the home page of Wampserver (localhost).
But this is easily fixable:
- With Wampserver 3.0.5 or more:
--- Right-Click -> Refresh
- With Wampserver before 3.0.4
--- Left-Click -> Apache -> Version -> 2.4.18 (Click on version in use)
--- Left-Click -> PHP -> Version -> 5.6.19 (Click on version in use)

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

Re: Changing editor on install causes problems
Posted by: Otomatic (Moderator)
Date: August 15, 2016 04:42PM

Hi,

@RiggsFolly
Quote
RiggsFolly
As this parameter is in a double quoted string using a single dos backslash is treated as an escape character and will cause you problems.

It being used by a PHP script remember!

As the executable path may contain spaces, it must be in double quotes.
The path is first used by PHP to create wampmanager.ini, but then it's Aestan Tray Menu that does the job of launching the editor and in the Tray Menu Aestan documentation, it is stated that for paths we can use the slash (/) or backslash (\).

Apache said:
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache"winking smiley.

And, to avoid having to double backslash (\\) for some cases,I prefer to use slash (/) everywhere.

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



Edited 1 time(s). Last edit at 08/15/2016 04:58PM by Otomatic.

Re: Changing editor on install causes problems
Posted by: asajay (---.hfc.comcastbusiness.net)
Date: August 18, 2016 04:42AM

Thank you for the pointers. It has taken me a couple of days to get back to this.

Otomatic Wrote:
-------------------------------------------------------
> Hi,
> If you want to change text editor, see the file
> wamp/wampmanager.conf and principaly:
>
> ;Path of the Text Editor used by Wampserver
> ;May be modfied with the absolute path of the Text
> Editor exe file
> ;(Use / instead of \)
> editor ="notepad.exe"
>
> I use
>
> editor ="J:/Util/Texte/Notepad++/notepad++.exe"
>
> or
>
> editor ="J:/Util/Texte/Ultraedit/uedit64.exe"
>
> without any problem.

I changed the editor set in the .conf file (and yes I used forward slashes). It opens the editor as expected, however it doesn't parse the name correctly and then proceeds to immediately try and print the file, and since there is no file displayed, it prints a blank page.

I have a screenshot, if there is a way to attach one (I haven't found it yet).

The file name it tries to open is:
C:\wamp\ampinpachepache2.4.18inhp.ini

Just exactly like that.

Note there are no backslashes in the filename. So something is mangling it when UltraEdit32 tries to open. My guess is this has something to do with the file being a symlink and pointing to the real file. Notepad seems to open it juts fine, but my version of UE32 does not. Since you are not having a problem with your version, I must suspect it's the version of UltraEdit I have. If I open the actual .ini file directly, it opens fine. But the way WampServer is linking to it, fails to open it properly.

There are -no- error messages on the served wamp (localhost) page.

I downloaded an installed the demo for the latest version of UltraEdit and the problem is no longer there. Therefore the problem must be in my earlier (rather old) version of UltraEdit. Problem solved.


So to recap:
- Assigning my editor (old version Uedit32) was failing due to the editor (old version) and nothing to do with Wamp (current version); installing a current version of UltraEdit solved the problem.
- The php.ini file is only a symlink to the C:\wamp\bin\php\php5.6.19\phpForApache.ini file; as long as my editor opens the correct file when clicking from the Wamp menu, this information is superfluous.
- The wampserver.ini file is overwritten each time the server starts, in order to load any specific changes made, such as in the wampserver.conf file.

Alright, now on to more testing. Thank you for the help. smiling smiley

Asa Jay

Re: Changing editor on install causes problems
Posted by: Otomatic (Moderator)
Date: August 18, 2016 09:44AM

Hi,

> The file name it tries to open is: C:\wamp\ampinpachepache2.4.18inhp.ini
DOES NOT EXISTS.

c:/wamp/bin/apache/apache2.4.18/bin/php.ini is the correct path.

You can try with Notepad++. This is a powerful text editor with many possibilities, not as much as UltraEdit, but it is free.
So, in wampmanager.conf :
;Path of the Text Editor used by Wampserver
;May be modfied with the absolute path of the Text Editor exe file
;(Use / instead of \)
editor ="j:/util/texte/notepad++/notepad++.exe"

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



Edited 1 time(s). Last edit at 08/18/2016 12:43PM by Otomatic.

Sorry, only registered users may post in this forum.