Electronics & Programming


Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Lack of read permission on main script leads to E_WARNING [RSS Feed]

#1 Nov. 9, 2005 19:09:41

Ryan D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Lack of read permission on main script leads to E_WARNING

I believe that I've found a bug in the way that PHP handlespermission problems when accessing the main script.If I accesshttp://localhost/foo.phpand PHP does not have permissionto read foo.php, I get an E_WARNING rather than an E_COMPILE_ERROR(include vs. require). This is in PHP 5.1 RC4. I've fixed this in alocal build by patching zend_execute_scripts in Zend/zend.c on line1079. zend_execute_scripts was calling zend_compile_file and passingZEND_INCLUDE in as the type argument rather than passing along itstype argument. The old code reads:EG(active_op_array) = zend_compile_file(file_handle, ZEND_INCLUDETSRMLS_CC);My patched version reads:

EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC);Because I'm not intimately familiar with the inner workings of theinterpreter, I'm not sure that this is the best way to fix thisproblem, but it seems like the most appropriate place that I could find.In case you are wondering why I care -- we have a PHP module thatmonitors PHP errors and redirects our customers to a customer servicepage any time that PHP encounters anything that the interpreterreally shouldn't recover from (E_CORE_ERROR, E_ERROR, E_PARSE,E_COMPILE_ERROR and E_USER_ERROR). The main script not beingreadable is certainly a case where we would like to redirect them toa customer service page. However, having an E_WARNING as the errormakes it difficult to identify this situation because we would nowhave to distinguish between this E_WARNING and any others that mightarise in the site. Having an E_COMPILE_ERROR would be much moredefinitive and more correct IMHO. Yes, we are taking other steps toensure that the permission on the PHP scripts for our site arecorrect, but mistakes do happen and we want to guarantee that ourcustomers have as good an experience as possible in the case ofunexpected errors (as any enterprise site should).Thoughts?


Ryan Dingman

Next Online Mortgage Technologies

PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php


  • Root
  • » PHP
  • » [PHP-DEV] Lack of read permission on main script leads to E_WARNING [RSS Feed]

Board footer

Moderator control

Enjoy the 24th of April

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support