Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6161645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:30:48+00:00 2026-05-23T21:30:48+00:00

I’m learning how to use the command line by requirement for a recent project.

  • 0

I’m learning how to use the command line by requirement for a recent project. I have a script that will be run during a cronjob, and am testing it by hitting it from the command line using Putty.

My script runs fine from the browser, but from the command line I get permission errors trying to include files or even check if they exist.

This only happens from the command line. This is what is in the console (I’m sure the correct script is executing, and all it does for now is check if a required file exists):

Here is the line in the terminal that executes the command:

secure:~/www/private/cron$ php -f ./update.php

Here is the output:

Warning: file_exists(): open_basedir restriction in effect.
File(/usr/local/apache/htdocs/example.com/private/modules/real_estate/config/condos.php)
is not within the allowed path(s):
(.:/tmp/:/var/tmp/:/usr/local/apache/htdocs/example.com/images/:/home/example/www/images/)
in /usr/local/apache/htdocs/example.com/private/cron/update.php
on line 43

I do not get this error running the script in a browser, which is confusing to me – but as I mentioned I am new to using the command line. I’ve tried every way I can think of to reference the file from update.php, and tried changing the include path, but nothing seems to work. Either I get the permission error or it can’t find the file.

Does anyone know why there is a difference between executing the script in a browser VS the command line, and what I can do to resolve this error? I’m happy to provide more information as requested.


More information:

This is my CLI output from php --ini:

Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: /usr/local/Zend/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)

This is the Loaded Configuration File entry in phpinfo(), from the browser:

/usr/local/Zend/etc/php.ini

So Loaded Configuration File appears to be the same in both environments.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:30:49+00:00Added an answer on May 23, 2026 at 9:30 pm

    You may want to run two different php.ini files for CLI vs Apache instances.

    One way to do that is to copy your current php.ini file to another directory – say into “/usr/local/Zend/etc/php_cli/php.ini” or a more convenient directory. Then, change settings in “/usr/local/Zend/etc/php_cli/php.ini” to better suit a command line environment (expand open_basedir a bit, log file paths, and other CLI-specific settings). Then, when executing CLI scripts, include the -c "/usr/local/Zend/etc/php_cli" switch to have CLI reference that ini file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.