Tuesday, September 9, 2014

PHP

I use PHP as a server side programming language. I use it in combination with the Apache web server and I have run across permissions problems concerning the running Apache program's process and the PHP files. I use PHP to manipulate the MySQL database. And I use a PDO interface to help avoid SQL injection vulnerabilities. This requires that PHP is installed and configured to use the PDO driver. PHP has a configuration file called "php.ini" and this is where you can setup "include_path". Within a PHP file you often include other PHP files and the include_path can be configured as a common reference directory. There are different approaches to including PHP resources in other files. And I am discovering that many people use a software program called "composer" which I plan to learn more about. Note that changes to the php.ini file will not be in operation until you restart your web server (I use Apache).

PHP Website
PHP PDO Driver
PHP Q & A

2 comments:

  1. The default memory size in my PHP configuration file was 32M. After implementing the google-api-php-client I began to bump up against this limit. I did some research and noticed people mentioning "ini_set()" statement. I tried to set the memory with this and it did not work. I then did a search for the key word "memory" within the php.ini file and found a statement called "memory_limit = ". I updated this from 32M to 128M and now my memory intensive scripts seem to working well. I am monitoring the script with the "top" process and I do not see the process eating up memory over time... so apparently there are no memory leaks. Perhaps the "ini_set()" was conflicting with the "memory_limit" statement.

    Just remember to test and analyze!

    ReplyDelete
    Replies
    1. I can't believe blogger won't let me edit my comment... it will be nice to integrate with their API.

      Delete