HOWTOlabs  
 Services     Software     Commentary     Design     Astral Musings   
PHP
Setup and basic uses
Related
Elsewhere

PHP, originally Personal Home Page, is an incredibly powerful and easy to use scripting language. Ideal for server-side database applications, it has started to eclipse Java as the defacto standard for web application development.

Debugging Tips

Check /var/log/httpd/error_log  Indeed even static HTML pages with quiet errors may have messages here that can be helpful.

File Uploading

PHP file uploading is typically set to a low value. Adjust /etc/php.ini to suit your needs ...
# cd /etc

# diff php.ini

  501c501
  < upload_max_filesize = 2M
  ---
  > upload_max_filesize = 50M

#  service httpd restart

Sessions / Cookies

Examples
Related
Elsewhere

Sessions (i.e. Session ID's) and Cookies are tied to a specific browser on a specific computer. A session always evaporates when a web browser quits/restarts. A cookie also evaporates when browser is quits if the cookie omits setting an expiration date or the browser is configured to ignore cookies. Typically cookies are used for sites that require usernames and passwords, but remember them and skip asking on subsequent visits from the same web browser. Other uses are minor preference settings for how a site should present itself (time zone, geographic, shopping carts, ...). If a password needs to be part of a cookie, best to ensure only https pages are allowed to interact with password cookie.

Cookies eventually expire. So cookies really only provide convenience for short term use (e.g. a few months). Eventually a cookie will expire and the user will have to provide their information again. Therefore, cookies are a way to make a site more convenient for frequent users, but any critical information that must persist over time must be stored in a server side database to ensure it doesn't suddenly vanish one day.

zap technologies
printable