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



vendor dir from filezilla



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] =&gt; Array
(
[H] =&gt; Array
(
[HiPayFullservice] =&gt; 18
)

)

[prefixDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
[HiPayFullservice] =&gt; Array
(
[0] =&gt; /home/XXXXX/vendor/composer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)

)

[fallbackDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[prefixesPsr0:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[fallbackDirsPsr0:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[useIncludePath:ComposerAutoloadClassLoader:private] =&gt;
[classMap:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[classMapAuthoritative:ComposerAutoloadClassLoader:private] =&gt;
[missingClasses:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[apcuPrefix:ComposerAutoloadClassLoader:private] =&gt;
)


the only difference between the not working and working local XAMPP sites print_r output is



[prefixDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
[HiPayFullservice] =&gt; Array
(
[0] =&gt; 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










share|improve this question




















  • 1




    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










  • So download composer.phar file and include it in your build. Then php composer.phar install
    – Justinas
    Nov 8 at 13:15















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



vendor dir from filezilla



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] =&gt; Array
(
[H] =&gt; Array
(
[HiPayFullservice] =&gt; 18
)

)

[prefixDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
[HiPayFullservice] =&gt; Array
(
[0] =&gt; /home/XXXXX/vendor/composer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)

)

[fallbackDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[prefixesPsr0:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[fallbackDirsPsr0:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[useIncludePath:ComposerAutoloadClassLoader:private] =&gt;
[classMap:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[classMapAuthoritative:ComposerAutoloadClassLoader:private] =&gt;
[missingClasses:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[apcuPrefix:ComposerAutoloadClassLoader:private] =&gt;
)


the only difference between the not working and working local XAMPP sites print_r output is



[prefixDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
[HiPayFullservice] =&gt; Array
(
[0] =&gt; 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










share|improve this question




















  • 1




    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










  • So download composer.phar file and include it in your build. Then php composer.phar install
    – Justinas
    Nov 8 at 13:15













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



vendor dir from filezilla



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] =&gt; Array
(
[H] =&gt; Array
(
[HiPayFullservice] =&gt; 18
)

)

[prefixDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
[HiPayFullservice] =&gt; Array
(
[0] =&gt; /home/XXXXX/vendor/composer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)

)

[fallbackDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[prefixesPsr0:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[fallbackDirsPsr0:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[useIncludePath:ComposerAutoloadClassLoader:private] =&gt;
[classMap:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[classMapAuthoritative:ComposerAutoloadClassLoader:private] =&gt;
[missingClasses:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[apcuPrefix:ComposerAutoloadClassLoader:private] =&gt;
)


the only difference between the not working and working local XAMPP sites print_r output is



[prefixDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
[HiPayFullservice] =&gt; Array
(
[0] =&gt; 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










share|improve this question















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



vendor dir from filezilla



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] =&gt; Array
(
[H] =&gt; Array
(
[HiPayFullservice] =&gt; 18
)

)

[prefixDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
[HiPayFullservice] =&gt; Array
(
[0] =&gt; /home/XXXXX/vendor/composer/../hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice
)

)

[fallbackDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[prefixesPsr0:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[fallbackDirsPsr0:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[useIncludePath:ComposerAutoloadClassLoader:private] =&gt;
[classMap:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[classMapAuthoritative:ComposerAutoloadClassLoader:private] =&gt;
[missingClasses:ComposerAutoloadClassLoader:private] =&gt; Array
(
)

[apcuPrefix:ComposerAutoloadClassLoader:private] =&gt;
)


the only difference between the not working and working local XAMPP sites print_r output is



[prefixDirsPsr4:ComposerAutoloadClassLoader:private] =&gt; Array
(
[HiPayFullservice] =&gt; Array
(
[0] =&gt; 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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 12:13

























asked Nov 8 at 10:12









Goran

5771721




5771721








  • 1




    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










  • So download composer.phar file and include it in your build. Then php composer.phar install
    – Justinas
    Nov 8 at 13:15














  • 1




    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










  • So download composer.phar file and include it in your build. Then php 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












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.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    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
































    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.






    share|improve this answer

























      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.






      share|improve this answer























        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 8 at 15:15









        engrhussainahmad

        957




        957






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            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




















































































            Popular posts from this blog

            Schultheiß

            Verwaltungsgliederung Dänemarks

            Liste der Kulturdenkmale in Wilsdruff