0

I am using AWS EC2 linux2 and trying to run my php script from command line console :

I have my files in folder /var/www/html/myfolder/test.php

test.php

<?php
require ('./functionfile.php');
echo  'hello';
?>

I have functionfile.php in that same folder.

when i try to run with /bin/php /var/www/html/myfolder/test.php then it gives me an error

failed to open stream: No such file or directory in /var/www/html/myfolder/test.php on line 2
PHP Fatal error:  require(): Failed opening required './functionfile.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/myfolder/test.php on line 2

When i directly run this file using http://my-public-dns.com/myfolder/test.php then it works but not working from command line.

0 Answers0