Getting Validator to parse PHP files

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
Topshed9
Rank I - Novice
Rank I - Novice
Posts: 10
Joined: Wed May 20, 2009 1:45 am
Location: Melbourne Australia
Contact:

Getting Validator to parse PHP files

Post by Topshed9 »

Hello,
I just upgraded to pro and I want to get my php code parsed by Validator

I have PHP 5 installed on Drive G and the link as
G:\wamp\bin\php\php5.2.8\php.exe
which is correct BUT
When I try to validate a php file I get this error message repeated for every line

PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.2.8/ext/php_gd2.dll' - The specified module could not be found.

So although I tell it it's on drive G:, It still looks in Drive C:

I really don't want to install Validator on Drive C: if Possible as Drive G is where all my Web stuff in installed

Thanks
Topshed

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3494
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch »

This sounds like a PHP issue. I don't know why PHP is calculating the wrong path to its DLLs. Could there be a php.ini file with a wrong configuration?

You might also want to try an older version of PHP and see if that works.

On another thought, does this always happen, even with a simple PHP document? Could you be using specific code that needs that DLL? I don't seem to have that DLL in my install.

If none of this works, I can try updating to the latest version on my system and seeing how it works, though my install is on my C drive.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3494
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch »

I installed PHP 5.2.9 (on my C drive) and it seems to work. I have the php_gd2.dll in the "ext" folder of the "php" folder.

I then tried moving the PHP files to a different drive (K:) and it still worked in my tests.

Are you still having trouble?

Topshed9
Rank I - Novice
Rank I - Novice
Posts: 10
Joined: Wed May 20, 2009 1:45 am
Location: Melbourne Australia
Contact:

Post by Topshed9 »

Hi,
thank you for your replies, The only way I could get it to work was to install Valedator into my G: drive and everything then worked

One other query this code throws errors

Code: Select all

<table width="1020" border="2" cellspacing="2">
  <tr>
    <th>BR No.</th>
    <th>GWR No.</th>
    <th>Pre GWR
     No.</th>
    <th colspan='2'>Loco Name</th>
  </tr>
  <tr>
   <?php echo "<td>".$row['br_no']."</td>"; ?> 
   <?php echo "<td>".$row['other_no']."</td>"; ?>
   <?php echo "<td>".$row['prev']."</td>"; ?>
   <?php echo "<td colspan='2'>".$row['loco_name']."&nbsp;</td>"; ?>
  </tr>
Error in line 36 at character 2: This table doesn't appear to have the same number of cells in each of its 2 rows. Number of cells in each row, starting with the first row: 3, 0. Note that for the purposes of this message, a table cell with a "colspan" or "rowspan" value greater than 1 is considered to be multiple cells.
Valedator apparantly does nor recognise Table tags inside Php Echo

Any ideas apart from a rewrite, or perhaps I can turn off that error somewhere

Thanks
topshed9

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3494
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch »

Topshed9 wrote:Hi,
thank you for your replies, The only way I could get it to work was to install Valedator into my G: drive and everything then worked
OK, glad you got it to work. I wonder if this is a current/working directory issue. Perhaps it is not being set correctly. I will check it out.
Topshed9 wrote:Any ideas apart from a rewrite, or perhaps I can turn off that error somewhere
You should be able to disable that message by right-clicking on it (in CSE HTML Validator's Editor) and disabling it.

Another option might be to enclose that part of the document in "cseignore" comments. See:
http://www.htmlvalidator.com/CSEForum/v ... .php?t=144

And of course you could always rewrite it so PHP is outputting the entire table and echo's are not used to output the table tags... or not using PHP/echo to output any of the table tags might work as well.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3494
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re:

Post by Albert Wiersch »

Albert Wiersch wrote:OK, glad you got it to work. I wonder if this is a current/working directory issue. Perhaps it is not being set correctly. I will check it out.
In the next update, CSE HTML Validator should now set the current directory to the directory that the EXE being run is in (instead of defaulting to the directory of the calling process which is usually CSE HTML Validator). I'm not sure if this will help with this problem, but it seems like it can't hurt.

Post Reply