|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-10 22:02 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 07:00:01 2025 UTC |
Description: ------------ If I run a script with parse errors using the CLI on Debian with some of the Zend software installed on it, parse errors are not reported at all by default. This is fine, seeing as I can run "php -l file.php" and it "should" report something more meaningful than: "Errors parsing file.php" If I put this file onto Windows and run it using the 4.3.3 CLI, I get this: "Parse error: parse error, unexpected '{' in virtuele-backup.php on line 45 Errors parsing virtuele-backup.php" output of php -v ----------------- PHP 4.3.2 (cli) (built: Jul 16 2003 15:43:08) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies with Zend Extension Manager v1.0.0, Copyright (c) 2003, by Zend Technologies with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend Technologies with <b>DISABLED</b> Zend Performance Suite v3.5.0, Copyright (c) 1999-2003, by The Accelerator presently supports only Apache, ISAPI and FastCGI SAPIs output of php -m ---------------- [PHP Modules] Zend Optimizer ctype mysql overload pcre posix session standard tokenizer wddx xml [Zend Modules] <b>DISABLED</b> Zend Performance Suite Zend Extension Manager Zend Optimizer I think it is the Zend stuff that is suppressing the errors as I have another server that is reporting errors without the Zend stuff installed. This server is exactly the same is every other respect. * Please note that I will not be able to install higher versions of php to test this as it is a production server and the Zend software we have is not certified for higher versions * Reproduce code: --------------- Sorry this is more than 20 lines long, but I have no other way of getting this to you: #!/usr/local/bin/php <?php // Check if mysql extension is loaded or not. CLI is not compiled with mysql support? if (!extension_loaded ('mysql')) dl ('mysql.so'); // Get current working directory $cwd = getcwd(); // Create .offline file to stop Virtuele from accessing the database $retVal = `touch /var/www/webroot/.offline`; // Connect to MySQL $db = mysql_connect ('localhost', '*******', '*******') or die ('Cant connect to mysql: ' . mysql_error()); $db = mysql_select_db ('virtuele', $db) or die ('Cant connect to Virtuele database: ' . mysql_error()); // Lock database tables $sql = 'FLUSH TABLES WITH READ LOCK'; if (!mysql_query ($sql)) { echo "ERR: Could not establish table locks: " . mysql_error() . "\n"; } // Backup the database // Current timestamp $dt = date("Ymd-His", time()); chdir ('/var/lib/mysql'); $retVal = `tar zcvf /backup/virtuele_$dt.tgz virtuele/`; echo $retVal . "\n"; // Unlock database tables $sql = 'UNLOCK TABLES'; if (!mysql_query ($sql) { echo "ERR: Could not unlock database tables" . mysql_error() . "\n"; } // Close MySQL connection mysql_close ($db); // Remove the .offline file $retVal = `rm /var/www/webroot/.offline`; // Put the focus back into the same directory we started in chdir ($cwd); ?> Expected result: ---------------- "Parse error: parse error, unexpected '{' in virtuele-backup.php on line 45 Errors parsing virtuele-backup.php" Actual result: -------------- "Errors parsing virtuele-backup.php"