Username:
Password:
FileMaker 9 & PHP Foundations Tutorials

PHP Basics / Configuring PHP pt. 2

Subtitles of the Movie

There are times when you don't have access to the PHP ini file because you don't physically control or have physical access to the web server. Many times you have an outside company doing your web hosting for you and they will not give you access to the web server or the PHP ini file. In those instances you can change your PHP directives manually by setting them in your PHP script. Let's look at how that's done and we'll use our display errors as an example. I'm going to go ahead and open up the 0206.php file where we have some leftover code from our previous lesson using the require function for a file that was not here or didn't exist. Because of that, when we refresh the browser, we have an error displayed that tells us the name of the script and the location of the script and other information that we don't want to come to the browser during run time. Because of this, we'll want to make sure that we use the ini set function to set our display errors directive to off. It's important to use the actual name of the directive that's inside the PHP ini file. I'm going to go back to that directive and just copy and paste it to make sure that my syntax is accurate. Here is the display errors directive. Now I'll use the ini set function. I'll tell PHP the directive I want to set is display errors comma and the value for that directive is going to be off. Now, when I refresh this web page, even though the error still occurs, the error is not displayed in the browser. This concludes our discussion on configuring your PHP installation. We've talked about how to use the PHP info function to display your current configuration settings, how to locate your PHP ini file, how to open the file up and change the settings that you desire, the fact that you have to restart the web server for the changes to take effect and if you're unable to use the PHP ini file, how to set PHP configuration directives inside of your running PHP script. Remember, if you use the ini set function, those settings will only change while the script is running. Once the script stops execution, the settings will go back to the default value. So if there's a particular setting that you need to have for every page in your program, you'll want to either place the ini set directive at the very top of every page or even better, place it in your include file that you'll include on every page. This ends our discussion on configuring your settings in PHP.

Tutorial Information

Course: FileMaker 9 & PHP Foundations
Author: Lance Hallberg
SKU: 33786
ISBN: 1-933736-99-2
Release Date: 2007-08-22
Duration: 9.5 hrs / 107 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 81,350 Video Tutorials (20,800 free)
  • Video Available as Flash or QuickTime
  • Over 782 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available