DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Languages
  4. HowTo: Administer Your System with PHP

HowTo: Administer Your System with PHP

John Esposito user avatar by
John Esposito
·
Nov. 02, 11 · Interview
Like (0)
Save
Tweet
Share
4.82K Views

Join the DZone community and get the full member experience.

Join For Free

Many web developers would love to do everything in PHP -- maybe because it was their first web programming language, or because plenty of pre-written code is available online; or maybe just because PHP is actually quite fast.

When the PHP engine is being called by a web server, there's one thing you can't easily do with PHP: administer your system.

But, as this post from the Winning Web Works blog points out, it's actually pretty easy to use PHP 4.2.0 and above for lots of server-related tasks.

The reason? PHP 4.2.0 (and above) can be invoked directly from the command line.

Short version:

Although many have attempted to use PHP as the “golden hammer” in the past, this strategy often proves highly inconvenient simply because server-based tasks were simply never meant to run over extended periods of time. However, as of PHP version 4.2.0, it’s possible to directly invoke the PHP engine by calling it from the operating system command-line, available via a new SAPI type known as the CLI (Command Line Interface). This new capability opens up the possibility for system administrators to use PHP for managing various server-related tasks, among which include duties pertinent to managing system backups, monitoring system resources, and parsing logs. 

The full post shows you how to make sure your system is configured to handle command-line PHP, offers a simple example (timezone adjustment calculator), and answers a few likely questions you might have. No real-world sysadmin example scripts just yet, but (the post promises) those are coming.

If you're super-comfortable with PHP, and would like to stretch your PHP beyond web programming, then the article is a good read.

PHP operating system

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Submit a Post to DZone
  • The 5 Books You Absolutely Must Read as an Engineering Manager
  • How To Handle Secrets in Docker
  • Fargate vs. Lambda: The Battle of the Future

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: