jaxon-php / jaxon-js

The Jaxon javascript library https://www.jaxon-php.org.
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

shared hosting error #25

Closed frecervantes closed 7 months ago

frecervantes commented 7 months ago

Hi Mr Feuzeu, Thanks to your help, the site is working on localhost perfectly, but when load on a shared server, some things are wrong. I have an external file where the jaxon files are loaded and this is the sample.

external file

<?php
  require('./vendor/autoload.php');
  use Jaxon\Jaxon;
  use function Jaxon\jaxon;
  $jaxon= jaxon(); 

  class procesaform{
    function procesaTC($form_values){
      $respuesta = jaxon()->newResponse();
        somthing here....
        ..
      return $respuesta;
    }
  }

  $jaxon->register(Jaxon::CALLABLE_CLASS, procesaform::class);

  if($jaxon->canProcessRequest()){
    $jaxon->processRequest();
  }

  $jaxon->setOption("core.debug.on", false);
?>

// The server: PHP7.4, Mysql/Apache

// and the call to this function

<form id='formulario' name='formulario' action="#" method='post' 
    onsubmit="Jaxonprocesaform.procesaTC(jaxon.getFormValues('formulario'));return false;">

the message received.

[14-Mar-2024 18:32:31 UTC] PHP Fatal error: Uncaught Error: Class 'Jaxon\App\Dialog\Library\AlertLibrary' not found in /data0/xhoobiees.quest/public_html/cedigital.quest/vendor/jaxon-php/jaxon-core/src/Di/Traits/ViewTrait.php:66 Stack trace:

0 /data0/xhoobiees.quest/public_html/cedigital.quest/vendor/jaxon-php/jaxon-core/src/Di/Container.php(101): Jaxon\Di\Container->registerViews()

1 /data0/xhoobiees.quest/public_html/cedigital.quest/vendor/jaxon-php/jaxon-core/src/Di/Container.php(85): Jaxon\Di\Container->registerAll()

2 /data0/xhoobiees.quest/public_html/cedigital.quest/vendor/jaxon-php/jaxon-core/src/App/Ajax.php(89): Jaxon\Di\Container->__construct(Object(Jaxon\App\Ajax))

3 /data0/xhoobiees.quest/public_html/cedigital.quest/vendor/jaxon-php/jaxon-core/src/start.php(75): Jaxon\App\Ajax::getInstance()

4 /data0/xhoobiees.quest/public_html/cedigital.quest/vendor/composer/autoload_real.php(41): require('/data0/xhoobiee...')

5 /data0/xhoobiees.quest/public_html/cedigital.quest/vendor/composer/autoload_real.php(45): {closure}('800196073909aa5...', in /data0/xhoobiees.quest/public_html/cedigital.quest/vendor/jaxon-php/jaxon-core/src/Di/Traits/ViewTrait.php on line 66

but there are no errors on localhost

thanks for your help.

feuzeu commented 7 months ago

Hi,

Seems like the autoloading is not working properly. How did you install the application on the shared server?

frecervantes commented 7 months ago

just copy the files, all of them to the server. As I use to do with xajax. working on localhost and setting $jaxon->setOption("core.debug.on", true); show this: jaxon.debug.js:765 Uncaught TypeError: Assignment to constant variable. at jaxon.debug.js:765:5 and this is the line 765: jxn = {} on jaxon.debug.js

anyway I can work and turning it to false no error messages.

feuzeu commented 7 months ago

Hi,

If you can install Composer on your server, just copy the composer.json and composer.lock files, and run composer install.

If not, run composer clear-cache on your localhost before copying the files.

feuzeu commented 7 months ago

Hi,

I've fixed the issue in the jaxon.debug.js file. https://github.com/jaxon-php/jaxon-js/releases/tag/v3.3.9

frecervantes commented 7 months ago

working perfect ¡ just run composer clear-cache and it works. thank you very much.

regards