April 3, 2024
As of Wine version 9.0, CSS HTML Validator is fully functional on Linux when installed using Wine. Currently, all features of CSS HTML Validator work: both the HTML editor/validator and the validation Batch Processor.
In CSS HTML Validator version 24.00 and earlier, File > Save As appends .css to non-CSS files. This will be fixed in version 24.01. File > Save already works as expected.
NEW!
The core validation engine of CSS HTML Validator has been ported to Linux!
The port, htmlval, runs under Linux as a Terminal application. Use your Linux editor of choice to edit web files, and obtain extensive validation and debugging information by invoking htmlval. No need to install Wine or a Windows Virtual Machine. Simply download and install the htmlval executable. It just works. Check out Native
Linux port of CSS HTML Validator and note the FREE limited version available by direct download.
The advantage of running the full CSS HTML Validator is its built-in editor, which is very good.
CSS HTML Validator is a full-featured CSS and HTML editor with integrated syntax checking. Though it is a Windows app, as of Wine 9.0 it installs and runs flawlessly on Linux under Wine. See the comprehensive review in the Wine Application Database
.
When installing CSS HTML Validator using Wine, be sure to use Wine 9.0 or later. Earlier versions of Wine were not sufficiently developed to fully support CSS HTML Validator. In CSS HTML Validator versions prior to 24.01, File > Save As misbehaves as described above.
If you want to create a new Wine Prefix to host CSS HTML Validator, follow the directions as given, but there are other options.
Option 1 If you do not already have an initialized Wine Prefix (i.e., if you have never executed winecfg), you can skip the first two commands in the next section (mkdir and export) and start by executing the third command, wine winecfg. That will create and initialize the default Wine Prefix ~/.wine, and CSS HTML Validator will end up being installed there. If you do this, you will not need to worry about exporting Wine Prefixes.
Option 2 However, if you want to install CSS HTML Validator into an existing Wine Prefix, skip the first command (mkdir). Start by exporting the name of your intended Wine Prefix, as in the second command (export), but use the name of your Wine prefix in place of .wine-validator. Then, skip the winecfg command and continue with the cd ~/Downloads command (or whatever cd command will take you to where your CSS HTML Validator installer is located).
This document also assumes the wine prefix is .wine-validator. If your Wine prefix has a different name, substitute the name of your prefix for .wine-validator everywhere.
Before proceeding, you may want to enable the Show Hidden Files option in your file browser (Nautilus or other). If you follow the recommendation of creating a Wine prefix with a name that starts with a period, like ~/.wine-validator, or if you accept the default Wine prefix, which is ~/.wine, that folder will be hidden and therefore invisible unless Show Hidden Files is enabled. This will be important if you enable PHP syntax checking or sound for CSS HTML Validator.
The next two commands do initial setup in advance of creating a Wine prefix. The name given here to the prefix is "wine-validator", but this can be replaced by any other name. For example, instead of ~/.wine-validator, you might prefer ~/.css-html.
$ mkdir -v ~/.wine-validator
$ export WINEPREFIX=~/.wine-validator
It is the next command, wine winecfg, that actually creates the Wine prefix by loading folder ~/.wine-validator with the magic that allows it to host running Windows apps. Be aware that winecfg generates lots of error messages, which you should simply ignore.
While winecfg is running, it may offer to install one or both of mono and geko. In that case, allow winecfg to do the downloads and installations. In fact, geko may ask to be downloaded and installed a second time. When this happens, it is probably because both Gecko 32-bit and Gecko 64-bit are needed, so allowing both to proceed is recommended.
When a dialog window opens and asks you to choose a Windows Version, the choice of Windows 10 is known to work with CSS HTML Validator. Other options in this dialog can be the defaults.
Eventually, winecfg will finish (messages from winecfg cease), but there may be no $ Terminal prompt. In that case, press the Enter key to display a Terminal prompt.
OK – go ahead and tell Wine to execute winecfg.
$ wine winecfg
The following cd command assumes that your CSS HTML Validator installation .exe file is in your ~/Downloads folder. If you have placed it somewhere else, such as on your Desktop, change the cd command to reference the actual location.
$ cd ~/Downloads
The name of the installation file in the following is taken to be installer.exe, but, in the command which installs CSS HTML Validator, you must replace this with the actual name of your installation file, which will be something like
css-html-validator-trial-setup.exe
or
css-html-validator-190122pro-x64-setup.exe.
Next is the command that does the actual installation of CSS HTML Validator. In this command, replace installer.exe as described above, and do not specify a path to the installer .exe file. cd must have been used to make the folder holding the installer .exe file the default. This is important.
When asked if a Desktop icon should be created, accept and choose either the current user option of the all users option. This icon will be needed.
It is possible that, at the end of the installation, Terminal does not display a $ prompt. In that case, press the Enter key.
$ wine installer.exe
Successful installation leaves a Launcher for CSS HTML Validator on your desktop or in your Applications or in both.
For some versions of Linux, no Launcher is left on the desktop, but you will find one – maybe two – launchers in Applications. If there are two launchers in Applications, one will open CSS HTML Validator, and the other will open the Batch Wizard in addition to CSS HTML Validator. If, when CSS HTML Validator opens, you see a Batch Wizard window, it can be closed, after which you are left with just CSS HTML Validator.
In case there is no CSS HTML Validator icon to be found anywhere, shut down and restart your computer. This happened once, with openSUSE Tumbleweed, and a re-boot was the fix.
You may now close the Terminal window.
$ exit
If there is a Launcher for CSS HTML Validator on your desktop, right-click it. If the window that opens includes an Allow Launching option, click it. If not, close the window and double-click the Launcher and, if prompted, click the Trust and Launch option. In the future, you will just double-click the Launcher to open CSS HTML Validator.
Open the email or file that contains your registration information and copy the contents to the clipboard.
It may be better not to close the source file after you copied the registration information. For some versions of Linux, CSS HTML Validator cannot access the copied information after the source file is closed.
If CSS HTML Validator is not running, open it by double-clicking its icon on the desktop or in Applications.
Then, navigate to Help > Register Program.
If the registration information in the clipboard is valid, CSS HTML Validator pre-fills the license information and you just need to select OK.
Recall that you may need to enable the "Show Hidden Files" option in your file browser. If your Wine prefix folder name begins with a dot (as in ~/.wine-validator), it is a hidden folder, and you will not be able to use Files to navigate to it unless its "Show Hidden Files" option is enabled.
Before proceeding, you may need to configure and test your computer's sound, which can be done by opening "Sound" in your computer's "Settings".
MS Windows keeps its sound files in
C:\windows\Media\
so you can enable sound for CSS HTML Validator by creating a Media folder inside ~/.wine-validator/drive_c/windows to hold your own sound files. Here is the full path.
~/.wine-validator/drive_c/windows/Media/
CSS HTML Validator uses two sounds, one when a validation finds errors or warnings, and another when a validation finds no errors or warnings. The default names for these .wav files are
Errors or warnings: Windows Critical Stop.wav
No errors or warnings: tada.wav
If files of those names are installed in ~/.wine-validator/drive_c/windows/Media/, close CSS HTML Validator (if it is open) and restart it. Beyond that, no other action may be required. However, if the sound files you install do not have the default names or are installed in a different folder, or if sound simply is not working, do the following.
Open CSS HTML Validator and press Ctrl+F4 to open the full Validator Engine options dialog. In case Ctrl+F4 does not work, the path through the menu is
Options > Validator Engine Options > Validator Engine Options [sic]
Scroll down the left column and click Sound.
In the panel on the right, both check boxes should be checked. You can enter the paths to your sound files, or you can navigate to the folder where you stored them by clicking the small folder icon to the right of a Play button. If your sound files are in the MS Windows default sound folder, the navigation path from within CSS HTML Validator is
My Computer > C: > windows > media
and the sound panel looks like this:
You can verify that each sound works by clicking its Play button.
If sound still is not working, re-check your system's Settings > Sound where you can select the output to which sound should be directed and where you can test your system's sound to ensure it is working.
All recent attempts to make this work for CSS HTML Validator running under Wine have failed, even though this procedure does work when running under Windows 10.
Recall that you may need to enable the "Show Hidden Files" option in your file browser. If your Wine prefix folder name begins with a dot (as in ~/.wine-validator), it is a hidden folder, and you will not be able to use Files to navigate to it unless the "Show Hidden Files" option is enabled.
Enabling PHP syntax checking in CSS HTML Validator requires several steps. (1) Choose a supported version of PHP. At the time this is being written, any version of PHP 8 is appropriate. (2) Download the version of Microsoft Visual C++ Redistributable for Visual Studio required for the chosen version of PHP, and install it to your CSS HTML Validator Wine prefix. For PHP 8, Microsoft Visual C++ Redistributable 2015-2022 is required. (3) Download and install into your Wine prefix the Microsoft Windows version of your chosen version of PHP. (4) Create and configure a php.ini file for running php.exe, the command line PHP executable. (5) Test php.exe to verify correct installation and execution. (6) Configure CSS HTML Validator to enable PHP syntax checking.
a. Browse to
https://windows.php.net/download/
and download the Zip file for a recent MS Windows compatible x64 Non Thread Safe version of PHP.
b. The panel on the left of the download page contains information on the appropriate version of Microsoft Visual C++ Redistributable for Visual Studio. Note the requirement for the version of PHP that was downloaded.
c. Verify the download's SHA256 hash (optional, but good to do).
You will need to download this file.
VC_redist.x64.exe
The steps a. b. c. in this section should be the best way to find the MS Redistributable files, but they may not work. In that case, do an Internet search for the version of Visual C++ Redistributable that you need, and then continue with Step d.
A query like
Microsoft Visual C++ Redistributable 2019
will find websites offering installers for VC16. Similarly for other versions.
a. Browse to
https://visualstudio.microsoft.com/downloads/
b. Scroll down and, below All Downloads, expand the Other Tools, Frameworks, and Redistributables item.
c. Look for Microsoft Visual C++ Redistributable for Visual Studio, and download the x64 version.
d. Assuming the download was to ~/Downloads, open a terminal window and execute the following (after replacing ~/.wine-validator with your own Wine prefix).
$ cd ~/Downloads
$ export WINEPREFIX=~/.wine-validator
$ wine VC_redist.x64.exe
The Microsoft Visual C++ Redistributable is now installed in your Wine prefix. You can verify this by executing
$ wine uninstaller
a. Unzip the downloaded PHP Zip file into the Program Files folder inside the drive_c folder of your Wine prefix.
After the unzip, the new folder will have a name something like php-8.3.4-nts-Win32-vs16-x64.
b. Rename the new folder to PHP (all upper case).
a. To create the php.ini file, cd into the PHP folder and copy php.ini-production to php.ini. Assuming the WINEPREFIX variable is initialized, the following will do the cd and copy.
$ cd "$WINEPREFIX/drive_c/Program Files/PHP/"
$ cp -v php.ini-production php.ini
b. While still in the PHP folder, use your favorite command line text editor to open php.ini for editing. If nano is the editor,
$ nano php.ini
c. Scroll down or search to locate the On Windows definition of extension_dir. Edit the definition line so that it does not begin with a semi-colon and contains extension_dir = ext
d. Scroll down or search to locate log_errors = and edit the setting so that it does not begin with a semi-colon and contains log_errors = On
e. Scroll down or search to locate the setting for error_log. Edit the setting so that it does not begin with a semi-colon and contains error_log = syslog
f. Save your edits to php.ini and exit from the text editor. If using nano, this is done with Ctrl-O followed by Ctrl-X.
g. Verify that folder PHP contains subfolders ext and syslog. Probably ext exists but syslog does not. Use the following terminal commands as needed to ensure both are present.
$ mkdir -v etc
$ mkdir -v syslog
All of the following terminal commands are to be executed from within the PHP folder.
a. Execute the following to get the installed PHP version. The following shows the Terminal command followed by its output.
$ wine php.exe --version
PHP 8.3.4 (cli) (built: Mar 13 2024 12:01:47) ( NTS Visual C++ 2022 x64 )
Copyright (c) The PHP Group
Zend Engine v4, Copyright (c) Zend Technologies
Here is what happens when the Microsoft Visual C++ Redistributable version does not match the PHP version.
$ wine php.exe --version
PHP Warning: 'C:\windows\system32\VCRUNTIME140.dll' 2.34 is not compatible with this PHP build linked with 14.28 in Unknown on line 0
b. Check an error-free PHP file for syntax errors. This uses the same command that CSS HTML Validator uses for PHP syntax checking.
$ wine php.exe -l -d display_errors=on /home/temp/TestFile-GOOD.php
No syntax errors detected in /home/temp/TestFile-GOOD.php
c. In the next test, the PHP file contains one syntax error.
$ wine php.exe -l -d display_errors=on /home/temp/TestFile-BAD.php
Parse error: syntax error, unexpected 'replace' (T_STRING) in /home/temp/TestFile-BAD.php on line 25
Errors parsing /home/temp/TestFile-BAD.php
d. You may close the Terminal window.
a. Open CSS HTML Validator and press Ctrl+F4 to open the full Validator Engine options dialog. In case Ctrl+F4 does not work, the path through the menu is
Options > Validator Engine Options > Validator Engine Options [sic]
b. Scroll down the left column and click PHP Checker.
c. The Path to php.exe input field should contain C:\Program Files\PHP\php.exe. If it does not, enter it.
d. Put a check mark in the Enable PHP syntax messages box.
e. Click OK.
f. Set the Default Valuation Mode to Full. This is done by navigating the menu tree thusly.
Options > Validator Engine Options > Set Default Validation Mode > Full
g. Now, you can test PHP syntax checking by loading a web page that has some PHP code and deliberately inserting a syntax error. Click the Validate button in the toolbar (not the Validate menu option in the menu bar) to see what happens.
Consider sharing your experience
Did you find this page helpful? Have constructive feedback? Wisdom to share?
Send email to david.l.bridges@gmail.com