Home arrow PHP arrow Page 3 - PHP CLI and Cron

PHP CLI and Cron

In this article, Jason will explain what CLI and Cron are and how to use them together within the PHP environment.

Author Info:
By: Jason Lam
Rating: 5 stars5 stars5 stars5 stars5 stars / 73
April 05, 2003
  1. · PHP CLI and Cron
  2. · Cron
  3. · Final Words

print this article

PHP CLI and Cron - Final Words
(Page 3 of 3 )

Future of PHP

PHP CLI and how PHP CGI will be invoked maybe changed in the future and possible can affect your use of PHP. It has been said php CGI binary will be renamed to php-cgi and the php CLI will be just php. There has been talk as well just to leave the way is or even merge the both CLI and CGI into one.

The main reason why CLI needs to be included into PHP by default is because PEAR requires the PHP binary to run. For more information visit the PHP website, http://www.php.net.


When making entries into Cron make a note of what user you doing this with. The Cron job may not run properly if the right permission is not assigned. As well make sure if your PHP script is accessing any external programs such as Sendmail that I has the proper permissions as well.

Other things to look out for are the environment settings. For example, if the PHP script is accessing Java classes you may have to wrap the PHP script with a shell script. Where the shell script includes the appropriate settings for both the Java Path and Classpath.

If accessing $_SERVER["argv"] and $_SERVER["argc"] do not work for you may want to try simply accessing the variables $argv and $argc, register globals need to be set on. This mostly like the case for older version of PHP.

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials