erdomester
erdomester

Reputation: 11829

Referencing from folder to folder

I am not sure I am doing this right.

I have a file at

/var/www/paymill-payment-form-master/request.php

In this file I need to reference to 3 other files that are in a different directory:

/var/www/paymill-php-master/lib/Services/Paymill

So what I am doing is this:

require "/paymill-php-master/lib/Services/Paymill/Transactions.php";
require "/paymill-php-master/lib/Services/Paymill/Clients.php";
require "/paymill-php-master/lib/Services/Paymill/Payments.php";

I am not sure the the code is wrong because of a reference error or something else.

Upvotes: 2

Views: 61

Answers (2)

Mithun Satheesh
Mithun Satheesh

Reputation: 27845

do like

require "../paymill-php-master/lib/Services/Paymill/Transactions.php";

Upvotes: 3

thnee
thnee

Reputation: 5927

The leading slash is probably your issue. Starting a search path with / means to start from the top of the file system tree.

Consider using relative paths:

require "../paymill-php-master/lib/Services/Paymill/Clients.php"

Upvotes: 0

Related Questions