path - what does it mean "(include_path='.:/usr/share/pear:/usr/share/php')"? -


i have file structure on ec2 : facing file referencing problem.

index.php -db   -config.php -cron   -cron1.php 

i have tried file referencing as:

`require_once (dirname(__file__).'/db/config.php');` `require_once (($_server['document_root']).'/db/config.php');` 

but cron doesn't run.it gives error in mail

`php warning:  require_once(/db/config.php): failed open stream: no such file or directory in /var/www/html/cron/cron1.php on line 3  warning: require_once(/db/config.php): failed open stream: no such file or directory in /var/www/html/cron/cron1.php on line 3  php fatal error:  require_once(): failed opening required '/db/config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/cron/cron1.php on line 3  fatal error: require_once(): failed opening required '/db/config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/cron/cron1.php on line 3` 

if @ php constant path_separator, see being ":" you.

if break apart string ".:/usr/share/pear:/usr/share/php" using character, 3 parts

  • . (this means current directory code in)
  • /usr/share/pear
  • /usr/share/ph

any attempts include()/require() things, in these directories, in order.

it showing in error message let know not find file trying require()

for first require, if being included index.php, dont need dir stuff, do:

require_once ( 'db/config.php'); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -