• Accessing uploaded files

    Overview By default, uploaded files are stored under /tmp, which is outside the pivot root of your account’s filesystem. These files may be accessed only by PHP. In certain circumstances, you may want to keep a copy of uploaded files for debugging. Solution Upload path can be adjusted by changing PHP’s tunable…

  • Working with Laravel config:cache

    Laravel provides a static cache utility via Artisan to collapse configuration under config/ into a single file to boost performance. Configuration may be cached using: php artisan config:cache When run from terminal, the paths provided may be incorrectly referenced when the application is accessed from the web resulting in application errors….

  • Troubleshooting PHP

    Overview PHP can fail for a variety of reasons. This is a growing list of reasons for which a PHP script may fail or behave inconsistently: Please note, some of this information may not apply as new .htaccess php directives no longer work in favor of using .user.ini with php-fpm….

  • Viewing PHP settings

    Overview Default PHP settings may be viewed either as a standalone page or within an application using phpinfo() or ini_get(). Default Environment Settings To view your default environment settings, create a file named phpinfo.php inside your document root. Inside this file, include the following line: <?php phpinfo(); ?> Access the…

  • Installing Laravel

    Overview Laravel is a PHP framework built around abstraction: do more with less coding. Laravel runs off PHP and MySQL. It is supported on any package, but works best with a package that supports terminal access. For this guide, we will assume terminal access is available. Installation Begin by logging…

  • Changing PHP settings

    Overview Certain default PHP settings may be insufficient for an application. For example, it may be necessary to accept large file uploads or display errors on-screen to facilitate rapid prototyping during early stages of an application. Solution PHP settings may be changed 3 ways, each with varying scope. All settings except…

  • Using Composer

    Overview Composer is a dependency manager for PHP akin to npm for Node and Bundler for Ruby. Composer is provided with hosting accounts on all v5+ platforms. On an older platform? Request a platform migration! This guide covers installing a local copy of Composer on your account. Installing You may download…

  • Displaying errors on-screen for debugging

    Overview During early development of a PHP application or to debug a problem, errors should be displayed in-browser to help spot typos, undefined variables, misconfiguration, and other logic flaws. Solution Enable display_errors and increase verbosity in error_reporting within PHP. As an example, configuration within a .htaccess  would be: php_flag display_errors On php_value error_reporting 9999999 Caveats Some…

  • open_basedir restriction message

    Overview When attempting to access a file in PHP, the script will yield a warning similar to: Warning: fopen(): open_basedir restriction in effect. File(/var/www/myresource) is not within the allowed path(s): (/home/virtual/site2/fst:/var/www/html:/usr/local:/usr/bin:/usr/sbin:/etc:/tmp:/proc:/dev:/.socket) in /home/virtual/site2/fst/var/www/html/myfile.php on line 3 Cause This is caused by mistakenly referencing a path within a pivot root…

  • Increasing max file upload size

    Overview By default, file uploads are restricted to less than 32 MB, on a server-by-server basis, to prevent abuse by unauthorized activity. If you need a larger allowance, a few variables are necessary to tune. Solution Allowing larger file uploads consists of three tunable variables. These variables may be tuned…