Title: Allow access to site from PHP CLI
Last modified: August 24, 2016

---

# Allow access to site from PHP CLI

 *  [SharmPRO](https://wordpress.org/support/users/sharmpro/)
 * (@sharmpro)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/allow-access-to-site-from-php-cli/)
 * I do need to run a cron job every 15min even if the site maintenance mode is 
   activated.
    Will it be ok to test argv[0] if REQUEST_URI is empty?
 * file: wp-manintenance-mode.php
    line: 613
 *  foreach ($this->plugin_settings[‘general’][‘exclude’] as $item) {
    if ((!empty(
   $_SERVER[‘REMOTE_ADDR’]) && strstr($_SERVER[‘REMOTE_ADDR’], $item)) || (!empty(
   $_SERVER[‘REQUEST_URI’]) && strstr($_SERVER[‘REQUEST_URI’], $item)) /*SPRO*/ 
   || (empty($_SERVER[‘REQUEST_URI’]) && isset($_SERVER[‘argv’]) && isset($_SERVER[‘
   argv’][0]) && !empty($_SERVER[‘argv’][0]) && strstr($_SERVER[‘argv’][0], $item))/*
   SPRO*/) { $is_excluded = true; break;
 * [https://wordpress.org/plugins/wp-maintenance-mode/](https://wordpress.org/plugins/wp-maintenance-mode/)

Viewing 1 replies (of 1 total)

 *  [Wesley Jordan](https://wordpress.org/support/users/wesleywealthbridgemarketingc/)
 * (@wesleywealthbridgemarketingc)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/allow-access-to-site-from-php-cli/#post-6000573)
 * I would also like to the SharmPRO’s solution integrated into the plugin. Thanks
   for providing it!

Viewing 1 replies (of 1 total)

The topic ‘Allow access to site from PHP CLI’ is closed to new replies.

 * ![](https://ps.w.org/wp-maintenance-mode/assets/icon-256x256.gif?rev=3027645)
 * [LightStart - Maintenance Mode, Coming Soon and Landing Page Builder](https://wordpress.org/plugins/wp-maintenance-mode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-maintenance-mode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-maintenance-mode/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-maintenance-mode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-maintenance-mode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-maintenance-mode/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Wesley Jordan](https://wordpress.org/support/users/wesleywealthbridgemarketingc/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/allow-access-to-site-from-php-cli/#post-6000573)
 * Status: not resolved