-1

I am working on a Symfony 2 website, and having an issue only in production (cache is clear).

I am using the Payplug php api : I' ve put the files in the vendor folder, I use the namespace for the classes I use, and everything is ok on my local dev environment.

Once on the prod server, I get the error:

"Attempted to load class "Payplug" from namespace "Payplug". Did you forget a "use" statement for another namespace?"

I don't get why it gets a namespace error only on the prod server...

CONTROLLER :

<?php namespace KpmBundle\Controller; use KpmBundle\Entity\Marche; use KpmBundle\Entity\Marcheur; use KpmBundle\Entity\Commande; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Payplug\Payplug as Payplug; use Payplug\Payment as Payment; class MarcheController extends Controller { //code Payplug::setSecretKey(...); //more code } 

CLASS

<?php namespace Payplug; /** * The Payment DAO simplifies the access to most useful methods **/ class Payment { 

I really wonder why everything works fine on my local dev server ( app_dev.php and app.php ), but goes wrong on prod server...

Any idea would be appreciated,

regards

EDIT The files where installed via composer

5
  • I suppose you could try a "composer dumpautoload" on your production server but, from what you described, it probably won't help. Commented Jun 13, 2018 at 14:07
  • unhapily I have no ssh access, only ftp transfer... what file could be modified ? Commented Jun 13, 2018 at 14:12
  • 1
    When you did the transfer, did you transfer the entire vendor directory or just the payplug stuff? You need to make sure that all the stuff under vendor/composer is in sync between production and development. Commented Jun 13, 2018 at 14:18
  • I pushed the payplug stuff alone, and I see different sizes on the files under vendor/composer... you might have solved my problem ! Commented Jun 13, 2018 at 14:22
  • @cerad Good job, my vendor/composer wasnt sync with the dev one. Thx Commented Jun 13, 2018 at 14:24

1 Answer 1

0

I was using FTP, and transfered the vendor\payplug directory alone to the remote server ; as a result the vendor\composer wasn't sync between local and remote server. transfering the local vendor\composer solved the problem

Thx to @cerad

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.