Validate HTML offline on LAMP Dev Server
Posted by petegraham (petegraham), 25 October 2005I am looking for a way to validate the (X)HTML produced by a PHP script offline.
The site I am trying to validate is on a linux development server that currently has no Internet connection. Ideally I am looking for a PHP script (or possibly a linux application) that I can point at http://localhost/page_name.php which will tell me if it's valid or not.
I want to be able to set the validation check up as a cron job, therefore using a text editor to validate the embedded html in the source file isn't really an option.
I found this class http://validator.aborla.net/dev-zone.php5 but unfortunately it is written in PHP5, and all my servers run PHP4.
I have heard of HTML tidy but from research it doesn't appear to actually validate HTML.
I'm completely open to suggestions of how to achieve this. Thanks for your time,
Posted by admin (Graham Ellis), 25 October 2005Pete, as the servers are yours, it might not be a bad idea to load / upgrade one of them to PHP5 for the validation and run the code you've found and fancy, or even build a fresh release of Linux on an old PC you've got lying around.
Posted by petegraham (petegraham), 2 November 2005I've managed to get my hands on an old pc so have installed FC4, which comes with PHP5 on that.
Annoyingly PHP5 comes with mySQL support dissabled (i suspect they're trying to get us all to use sqlite) so I am going to have to recompile PHP to get those scripts up and running.
The dissabling of mySQL support by default strikes me as somewhat annoying as a vast majority of pre-written PHP scripts/applications require connectivity to mySQL databases. What do other people think? Maybe I'm just lazy...
Posted by admin (Graham Ellis), 2 November 2005It's a huge shame that MySQL drivers don't ship as standard with PHP5. Case of the Open Source world shooting itself in the foot, I'm afraid ... all to do with licensing issues and the incompatible open source licenses used by the MySQL folks that meant that the PHP folks couldn't bundle ... an issue that was resolved but only AFTER the drivers had been pulled.
Posted by petegraham (petegraham), 3 November 2005Hhhmm interesting, is there any chance of us seeing MySQL bundled with future versions of PHP?
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho