11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

www.it-ebooks.infoCHAPTER 2 • CONFIGURING YOUR ENVIRONMENTThe serialize_precision directive determines the number of digits stored after the floating pointwhen doubles and floats are serialized. Setting this to an appropriate value ensures that the precision isnot potentially lost when the numbers are later unserialized.allow_call_time_pass_reference = On | OffScope: <strong>PHP</strong>_INI_SYSTEM; Default value: OffFunction arguments can be passed in two ways: by value and by reference. Exactly how eachargument is passed to a function at function call time can be specified in the function definition, whichis the recommended means for doing so. However, you can force all arguments to be passed byreference at function call time by enabling allow_call_time_pass_reference.The discussion of <strong>PHP</strong> functions in Chapter 4 addresses how functional arguments can be passedboth by value and by reference, and the implications of doing so.Safe ModeWhen you deploy <strong>PHP</strong> in a multiuser environment, such as that found on an ISP’s shared server, youmight want to limit its functionality. As you might imagine, offering all users full reign over all <strong>PHP</strong>’sfunctions could open up the possibility for exploiting or damaging server resources and files. As asafeguard for using <strong>PHP</strong> on shared servers, <strong>PHP</strong> can be run in a restricted, or safe, mode.■ Note Due to confusion caused by the name and approach of this particular feature, coupled with the unintendedconsequences brought about by multiple user IDs playing a part in creating and owning various files, <strong>PHP</strong>’s safemode feature has been deprecated from <strong>PHP</strong> 5.3.0. I strongly recommend that you avoid using this feature.Enabling safe mode will disable quite a few functions and various features deemed to be potentiallyinsecure and thus possibly damaging if they are misused within a local script. A small sampling of thesedisabled functions and features includes parse_ini_file(), chmod(), chown(), chgrp(), exec(),system(), and backtick operators. Enabling safe mode also ensures that the owner of the executing scriptmatches the owner of any file or directory targeted by that script. However, this latter restriction inparticular can have unexpected and inconvenient effects because files can often be uploaded andotherwise generated by other user IDs.In addition, enabling safe mode opens up the possibility for activating a number of otherrestrictions via other <strong>PHP</strong> configuration directives, each of which is introduced in this section.safe_mode = On | OffScope: <strong>PHP</strong>_INI_SYSTEM; Default value: OffEnabling the safe_mode directive results in <strong>PHP</strong> being run under the aforementioned constraints.safe_mode_gid = On | OffScope: <strong>PHP</strong>_INI_SYSTEM; Default value: Off25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!