How to debug PHP composer autoloader
up vote
0
down vote
favorite
Im trying to use the HiPay php library. I installed the library with:
composer require hipay/hipay-fullservice-sdk-php
Resulting in a vendor directory with the HiPay library in it. In my order.php page I use
<?php
namespace TokenizationExample;
require __DIR__ . '/config/credentials.php';
require __DIR__ . '/vendor/autoload.php';
$config = new HiPayFullserviceHTTPConfigurationConfiguration($credentials['private']['username'], $credentials['private']['password']);
but I get i Class Not Found error on
$config = new HiPayFullserviceHTTPConfigurationConfiguration($credentials['private']['username'], $credentials['private']['password']);
It works on my local win 10 computer running XAMPP but it dont work when I upload the code to my hosting. I have check for missmatches in filnames but I cant spot the whats wrong.
This is the error:
Fatal error: Uncaught Error: Class 'HiPayFullserviceHTTPConfigurationConfiguration' not found in /home/XXXXX/order.php:8 Stack trace: #0 {main} thrown in /home/XXXXX/order.php on line 8
and the vendor dir created by composer
but how can I figure out what is wrong? And debug autoload.php? Sorry for newbie questions. Im a newbie at PHP
Update 1:
I did a "print_r" of the aulotloader
$autoloader = require __DIR__ . '/vendor/autoload.php';
print_r($autoloader,true)
and got this result from the hosting site were it doesnt work
ComposerAutoloadClassLoader Object
(
[prefixLengthsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[H] => Array
(
[HiPayFullservice] => 18
)
)
[prefixDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[HiPayFullservice] => Array
(
[0] => /home/XXXXX/vendor/composer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)
)
[fallbackDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
)
[prefixesPsr0:ComposerAutoloadClassLoader:private] => Array
(
)
[fallbackDirsPsr0:ComposerAutoloadClassLoader:private] => Array
(
)
[useIncludePath:ComposerAutoloadClassLoader:private] =>
[classMap:ComposerAutoloadClassLoader:private] => Array
(
)
[classMapAuthoritative:ComposerAutoloadClassLoader:private] =>
[missingClasses:ComposerAutoloadClassLoader:private] => Array
(
)
[apcuPrefix:ComposerAutoloadClassLoader:private] =>
)
the only difference between the not working and working local XAMPP sites print_r output is
[prefixDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[HiPayFullservice] => Array
(
[0] => C:xampphtdocshipay-examplevendorcomposer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)
)
so I renamed the HiPay folder to hipay and everythings works. Lesson learned, use "print_r" to debug your autoloder fckps
php composer-php autoloader
add a comment |
up vote
0
down vote
favorite
Im trying to use the HiPay php library. I installed the library with:
composer require hipay/hipay-fullservice-sdk-php
Resulting in a vendor directory with the HiPay library in it. In my order.php page I use
<?php
namespace TokenizationExample;
require __DIR__ . '/config/credentials.php';
require __DIR__ . '/vendor/autoload.php';
$config = new HiPayFullserviceHTTPConfigurationConfiguration($credentials['private']['username'], $credentials['private']['password']);
but I get i Class Not Found error on
$config = new HiPayFullserviceHTTPConfigurationConfiguration($credentials['private']['username'], $credentials['private']['password']);
It works on my local win 10 computer running XAMPP but it dont work when I upload the code to my hosting. I have check for missmatches in filnames but I cant spot the whats wrong.
This is the error:
Fatal error: Uncaught Error: Class 'HiPayFullserviceHTTPConfigurationConfiguration' not found in /home/XXXXX/order.php:8 Stack trace: #0 {main} thrown in /home/XXXXX/order.php on line 8
and the vendor dir created by composer
but how can I figure out what is wrong? And debug autoload.php? Sorry for newbie questions. Im a newbie at PHP
Update 1:
I did a "print_r" of the aulotloader
$autoloader = require __DIR__ . '/vendor/autoload.php';
print_r($autoloader,true)
and got this result from the hosting site were it doesnt work
ComposerAutoloadClassLoader Object
(
[prefixLengthsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[H] => Array
(
[HiPayFullservice] => 18
)
)
[prefixDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[HiPayFullservice] => Array
(
[0] => /home/XXXXX/vendor/composer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)
)
[fallbackDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
)
[prefixesPsr0:ComposerAutoloadClassLoader:private] => Array
(
)
[fallbackDirsPsr0:ComposerAutoloadClassLoader:private] => Array
(
)
[useIncludePath:ComposerAutoloadClassLoader:private] =>
[classMap:ComposerAutoloadClassLoader:private] => Array
(
)
[classMapAuthoritative:ComposerAutoloadClassLoader:private] =>
[missingClasses:ComposerAutoloadClassLoader:private] => Array
(
)
[apcuPrefix:ComposerAutoloadClassLoader:private] =>
)
the only difference between the not working and working local XAMPP sites print_r output is
[prefixDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[HiPayFullservice] => Array
(
[0] => C:xampphtdocshipay-examplevendorcomposer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)
)
so I renamed the HiPay folder to hipay and everythings works. Lesson learned, use "print_r" to debug your autoloder fckps
php composer-php autoloader
1
Set up yourcomposer.json
and runcomposer install
. It will generate proper autoloader
– Justinas
Nov 8 at 11:51
Composer was not available on the server.
– Goran
Nov 8 at 12:15
So downloadcomposer.phar
file and include it in your build. Thenphp composer.phar install
– Justinas
Nov 8 at 13:15
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Im trying to use the HiPay php library. I installed the library with:
composer require hipay/hipay-fullservice-sdk-php
Resulting in a vendor directory with the HiPay library in it. In my order.php page I use
<?php
namespace TokenizationExample;
require __DIR__ . '/config/credentials.php';
require __DIR__ . '/vendor/autoload.php';
$config = new HiPayFullserviceHTTPConfigurationConfiguration($credentials['private']['username'], $credentials['private']['password']);
but I get i Class Not Found error on
$config = new HiPayFullserviceHTTPConfigurationConfiguration($credentials['private']['username'], $credentials['private']['password']);
It works on my local win 10 computer running XAMPP but it dont work when I upload the code to my hosting. I have check for missmatches in filnames but I cant spot the whats wrong.
This is the error:
Fatal error: Uncaught Error: Class 'HiPayFullserviceHTTPConfigurationConfiguration' not found in /home/XXXXX/order.php:8 Stack trace: #0 {main} thrown in /home/XXXXX/order.php on line 8
and the vendor dir created by composer
but how can I figure out what is wrong? And debug autoload.php? Sorry for newbie questions. Im a newbie at PHP
Update 1:
I did a "print_r" of the aulotloader
$autoloader = require __DIR__ . '/vendor/autoload.php';
print_r($autoloader,true)
and got this result from the hosting site were it doesnt work
ComposerAutoloadClassLoader Object
(
[prefixLengthsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[H] => Array
(
[HiPayFullservice] => 18
)
)
[prefixDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[HiPayFullservice] => Array
(
[0] => /home/XXXXX/vendor/composer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)
)
[fallbackDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
)
[prefixesPsr0:ComposerAutoloadClassLoader:private] => Array
(
)
[fallbackDirsPsr0:ComposerAutoloadClassLoader:private] => Array
(
)
[useIncludePath:ComposerAutoloadClassLoader:private] =>
[classMap:ComposerAutoloadClassLoader:private] => Array
(
)
[classMapAuthoritative:ComposerAutoloadClassLoader:private] =>
[missingClasses:ComposerAutoloadClassLoader:private] => Array
(
)
[apcuPrefix:ComposerAutoloadClassLoader:private] =>
)
the only difference between the not working and working local XAMPP sites print_r output is
[prefixDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[HiPayFullservice] => Array
(
[0] => C:xampphtdocshipay-examplevendorcomposer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)
)
so I renamed the HiPay folder to hipay and everythings works. Lesson learned, use "print_r" to debug your autoloder fckps
php composer-php autoloader
Im trying to use the HiPay php library. I installed the library with:
composer require hipay/hipay-fullservice-sdk-php
Resulting in a vendor directory with the HiPay library in it. In my order.php page I use
<?php
namespace TokenizationExample;
require __DIR__ . '/config/credentials.php';
require __DIR__ . '/vendor/autoload.php';
$config = new HiPayFullserviceHTTPConfigurationConfiguration($credentials['private']['username'], $credentials['private']['password']);
but I get i Class Not Found error on
$config = new HiPayFullserviceHTTPConfigurationConfiguration($credentials['private']['username'], $credentials['private']['password']);
It works on my local win 10 computer running XAMPP but it dont work when I upload the code to my hosting. I have check for missmatches in filnames but I cant spot the whats wrong.
This is the error:
Fatal error: Uncaught Error: Class 'HiPayFullserviceHTTPConfigurationConfiguration' not found in /home/XXXXX/order.php:8 Stack trace: #0 {main} thrown in /home/XXXXX/order.php on line 8
and the vendor dir created by composer
but how can I figure out what is wrong? And debug autoload.php? Sorry for newbie questions. Im a newbie at PHP
Update 1:
I did a "print_r" of the aulotloader
$autoloader = require __DIR__ . '/vendor/autoload.php';
print_r($autoloader,true)
and got this result from the hosting site were it doesnt work
ComposerAutoloadClassLoader Object
(
[prefixLengthsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[H] => Array
(
[HiPayFullservice] => 18
)
)
[prefixDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[HiPayFullservice] => Array
(
[0] => /home/XXXXX/vendor/composer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)
)
[fallbackDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
)
[prefixesPsr0:ComposerAutoloadClassLoader:private] => Array
(
)
[fallbackDirsPsr0:ComposerAutoloadClassLoader:private] => Array
(
)
[useIncludePath:ComposerAutoloadClassLoader:private] =>
[classMap:ComposerAutoloadClassLoader:private] => Array
(
)
[classMapAuthoritative:ComposerAutoloadClassLoader:private] =>
[missingClasses:ComposerAutoloadClassLoader:private] => Array
(
)
[apcuPrefix:ComposerAutoloadClassLoader:private] =>
)
the only difference between the not working and working local XAMPP sites print_r output is
[prefixDirsPsr4:ComposerAutoloadClassLoader:private] => Array
(
[HiPayFullservice] => Array
(
[0] => C:xampphtdocshipay-examplevendorcomposer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)
)
so I renamed the HiPay folder to hipay and everythings works. Lesson learned, use "print_r" to debug your autoloder fckps
php composer-php autoloader
php composer-php autoloader
edited Nov 8 at 12:13
asked Nov 8 at 10:12
Goran
5771721
5771721
1
Set up yourcomposer.json
and runcomposer install
. It will generate proper autoloader
– Justinas
Nov 8 at 11:51
Composer was not available on the server.
– Goran
Nov 8 at 12:15
So downloadcomposer.phar
file and include it in your build. Thenphp composer.phar install
– Justinas
Nov 8 at 13:15
add a comment |
1
Set up yourcomposer.json
and runcomposer install
. It will generate proper autoloader
– Justinas
Nov 8 at 11:51
Composer was not available on the server.
– Goran
Nov 8 at 12:15
So downloadcomposer.phar
file and include it in your build. Thenphp composer.phar install
– Justinas
Nov 8 at 13:15
1
1
Set up your
composer.json
and run composer install
. It will generate proper autoloader– Justinas
Nov 8 at 11:51
Set up your
composer.json
and run composer install
. It will generate proper autoloader– Justinas
Nov 8 at 11:51
Composer was not available on the server.
– Goran
Nov 8 at 12:15
Composer was not available on the server.
– Goran
Nov 8 at 12:15
So download
composer.phar
file and include it in your build. Then php composer.phar install
– Justinas
Nov 8 at 13:15
So download
composer.phar
file and include it in your build. Then php composer.phar install
– Justinas
Nov 8 at 13:15
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The code you have uploaded on server will be running on Linux which is case sensitive but in Windows operating system this doesn't matter.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The code you have uploaded on server will be running on Linux which is case sensitive but in Windows operating system this doesn't matter.
add a comment |
up vote
0
down vote
The code you have uploaded on server will be running on Linux which is case sensitive but in Windows operating system this doesn't matter.
add a comment |
up vote
0
down vote
up vote
0
down vote
The code you have uploaded on server will be running on Linux which is case sensitive but in Windows operating system this doesn't matter.
The code you have uploaded on server will be running on Linux which is case sensitive but in Windows operating system this doesn't matter.
answered Nov 8 at 15:15
engrhussainahmad
957
957
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53205556%2fhow-to-debug-php-composer-autoloader%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Set up your
composer.json
and runcomposer install
. It will generate proper autoloader– Justinas
Nov 8 at 11:51
Composer was not available on the server.
– Goran
Nov 8 at 12:15
So download
composer.phar
file and include it in your build. Thenphp composer.phar install
– Justinas
Nov 8 at 13:15