MaticDiba
MaticDiba

Reputation: 905

Running php script from another php script in different folder

I have web application that is running in root directory. In another directory I have some application that I want to run and get result from. So from /root/myscript.php I want to call the script /app/index.php which returns some value. The problem is that index.php also includes some scripts which are in /app folder. And because my working directory is in /root directory, this scripts does not get included.

Is there any other way I can run index.php script from myscript.php and enable index.php to include all needed files?

Upvotes: 0

Views: 700

Answers (1)

Alex
Alex

Reputation: 8072

You can include file from parent directory:

include('../somefilein_parent.php');

Upvotes: 1

Related Questions