
|
|
|||
Simple System Maintenance with PHP-CLIBy Akash Mehta2008-01-21
Simple System Maintenance with PHP-CLI
PrerequisitesAs you follow this tutorial, I'll presume you're familiar with the basics of PHP, and have built practical software with it – this tutorial is about maintaining that practical software. You don't actually need anything to maintain to follow this tutorial, however; just read through and experiment with the code snippets. As we're working with PHP from command line, access to the command line of a system with PHP is essential; if you don't have this yet, see the "Quick setup' section below. Basic command line knowledge is highly recommended as well. Finally, being able to recognise a SQL query helps but is not at all required; we'll be interacting with a database later in the tutorial. Quick setupIf you're on a shared host, or an old server, you may not have access to a console with PHP; testing with your local machine might be easiest. If you're on Windows, XAMPP Lite is a great way to get up and running with a disposable web server with PHP CLI. XAMPP is also available for Linux systems but you're probably better off with your distribution's package manager – an apt-get php5 would do on Ubuntu/Debian, for example, and this will also put the binaries in the right locations. To be able to run PHP by simply calling the PHP binary at your console, you'll need to add your PHP directory to your PATH environment variable; try this guide for Windows and this guide for UNIX if you aren't familiar with this. Finally, depending on your PHP configuration, you may find that you need to suppress the HTTP headers, which obviously won't be of much use on the console. Instead of the php used in this guide, try running php –q if you find you're getting content-type or similar headers before your output. Tutorial Pages: » Simple System Maintenance with PHP-CLI » Fundamentals » PHP-CLI 101 » Get Maintaining! » Sample Scripts » Have Fun! |
||||
| About the NetVisits, Inc Network | Write For Us | Advertise Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy. |
Visit other NetVisits, Inc. sites: |