sennetta Posted June 1, 2010 Share Posted June 1, 2010 I inherited an application, and my install can't handle # comments (running 5.3.0 on a mac). It keeps on throwing Zend config exceptions. Is there anything I can set in php.ini to allow this? Cheers Link to comment https://forums.phpfreaks.com/topic/203494-deprecated-comments/ Share on other sites More sharing options...
Daniel0 Posted June 1, 2010 Share Posted June 1, 2010 Works fine for me in PHP 5.3.3-dev. Could you post the code that fails as well as the actual error message. Link to comment https://forums.phpfreaks.com/topic/203494-deprecated-comments/#findComment-1066046 Share on other sites More sharing options...
sennetta Posted June 1, 2010 Author Share Posted June 1, 2010 Thanks for your reply. Here is the output. Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'Comments starting with '#' are deprecated in /Users/username/www/application/config/mac-desktop_config.ini on line 3 Comments starting with '#' are deprecated in /Users/username/www/application/config/mac-desktop_config.ini on line 4 Comments starting with '#' are deprecated in /Users/username/www/application/config/mac-desktop_config.ini on line 38' in /Users/username/www/application/library/Zend/Config/Ini.php:117 Stack trace: #0 /Users/username/www/application/bootstrap/mac-desktop.php(220): Zend_Config_Ini->__construct('/Users/username...', 'main') #1 /Users/username/www/application/web_root/index.php(7): include('/Users/username...') #2 {main} thrown in /Users/username/www/application/library/Zend/Config/Ini.php on line 117 This is the code from the class Zend_Config_Ini.php: set_error_handler(array($this, '_loadFileErrorHandler')); $iniArray = parse_ini_file($filename, true); // Warnings and errors are suppressed restore_error_handler(); // Check if there was a error while loading file if ($this->_loadFileErrorStr !== null) { /** * @see Zend_Config_Exception */ require_once 'Zend/Config/Exception.php'; throw new Zend_Config_Exception($this->_loadFileErrorStr); } And this is the config file that it's having trouble with. [main] database.adapter = PDO_MYSQL #database.cfg.host = 89.234.32.172 #database.cfg.host = 10.10.10.170 database.cfg.host = localhost .. snip .. [images] # possible placeholder 6564a3dcd68ff39a732b6869eeb6a35a.jpg product.placeholder.src = /images/ product.placeholder.path = /web_root/images/ product.placeholder.height = 200 product.placeholder.width = 200 I could just change the comments, but there are LOADS more of them. Link to comment https://forums.phpfreaks.com/topic/203494-deprecated-comments/#findComment-1066048 Share on other sites More sharing options...
Daniel0 Posted June 1, 2010 Share Posted June 1, 2010 You'll have to convert the config file to ;-style comments. If you're using any half-decent editor, you can just use its search and replace feature. Link to comment https://forums.phpfreaks.com/topic/203494-deprecated-comments/#findComment-1066052 Share on other sites More sharing options...
sennetta Posted June 1, 2010 Author Share Posted June 1, 2010 Have done. Cheers. Link to comment https://forums.phpfreaks.com/topic/203494-deprecated-comments/#findComment-1066071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.