Top Nav

Archive | PHP

Determine PHP Compile Settings

How can one determine what config settings were used to build PHP? This is a question that comes up when you want to upgrade to a new version of PHP and need to replicate the original settings. Another case is when you are setting of a development server that must be a mirror of your production server.

There are two good ways to proceed:

1. If folder where the source code was built is available then take a look at the file named “config.status”. At the top of this file you’ll find comments looking something like this:

The text in bold is the config line with all the options used.

2. The second method requires that you create a file on the server inside the webspace. Place the following line in the file:

Call the file “test.php”. Next with a web browser access the file with:

http://www.myserver.com/test.php

You’ll get back an extensive report on the configuration of the PHP install on the server. In the first section of the report, under the label “Configure Command” you’ll see something like:

Make sure you remove the test.php file after you are finished with it. The file contains information that could assist hackers so you don’t want to leave it sitting around.

0

File Upload Size Limits

In php.ini the following parameters impact file uploads:

  • file_uploads
    http://www.php.net/manual/en/ini.sect.file_uploads.php#ini.file-uploads
  • upload_tmp_dir
    http://www.php.net/manual/en/ini.sect.file_uploads.php#ini.upload-tmp-dir
  • upload_max_filesize
    http://www.php.net/manual/en/ini.sect.file_uploads.php#ini.upload-max-filesize
  • post_max_size
    http://www.php.net/manual/en/ini.sect.data-handling.php#ini.post-max-size
  • max_input_time
    http://www.php.net/manual/en/ref.info.php#ini.max-input-time
  • memory_limit
    http://www.php.net/manual/en/ini.sect.resource-limits.php#ini.memory-limit

Apache might also impose a limit on the size of file uploads using the LimitBodyRequest directive. See http://httpd.apache.org/docs-2.1/ko/mod/core.html#limitrequestbody for details.

0