500 Error when saving specific process

Discussion in 'PHP' started by Parsav, Apr 30, 2018.

  1. Parsav

    Parsav Member

    Hey
    I have an issue with saving a process on my website running on Litespeed
    it's saving a portfolio add/change items and it freeze after hiting the save bottun i've checked my code many times is nothing wrong since it is running currectly in apache in another webserver
    Code:
    plugin.js?v=1.84:8 POST https://mywebsite.com/portfolio/save 500 ()
    send @ plugin.js?v=1.84:8
    ajax @ plugin.js?v=1.84:8
    e.fn.ajaxSubmit @ plugin.js?v=1.84:10
    (anonymous) @ script.js?v=2.338:1199
    dispatch @ plugin.js?v=1.84:7
    q.handle @ plugin.js?v=1.84:7
     
  2. Jon K

    Jon K Administrator Staff Member

    Do you see anything in the error log for this issue? Or the std err log?
     
  3. Parsav

    Parsav Member

    its says Failed to load resource: the server responded with a status of 500 () in the chrome
     
  4. Jon K

    Jon K Administrator Staff Member

    What about the error log on your server? That should give you better insight on what exactly is causing the 500 error.
     
  5. Parsav

    Parsav Member

    nothing at all... but it is an AJAX code with save parameter... it is working with apache but when i switch to lite speed it will freeze and give me error 500 in chrome inspect
     
  6. Tishu

    Tishu Well-Known Member

    Hello,
    If you have custom php logs, did you check them? and is this cms (if yes what its).
     
  7. Parsav

    Parsav Member

    Code:
    [28-Apr-2018 15:01:39 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function iconv() in /public_html/includes/libraries/functions.php:859
    Stack trace:
    #0 /public_html/includes/models/portfolio.php(3): toAscii('ghf')
    #1 /public_html/includes/controllers/PortfolioController.php(48): save_portfolio('ghf', '', '0', '')
    #2 /public_html/includes/application.php(955): PortfolioController->save()
    #3 /public_html/includes/application.php(882): Router::load(Object(Route))
    #4 /public_html/includes/application.php(70): Router::run()
    #5 /public_html/index.php(19): Application->run()
    #6 {main}
      thrown in /public_html/includes/libraries/functions.php on line 859
    its pure handmade PHP-MySQL front-end cms
    but everything is working fine in apache :|
     
    Last edited: May 4, 2018
  8. NiteWave

    NiteWave Administrator

    how did you build or install lsphp ?
    if you install lsphp via rpm ( https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:php:rpm )
    iconv.so is in lsphp56-common for example. then just run
    #yum install lsphp56-common
    will solve it.
     
  9. Parsav

    Parsav Member

    thanks!! I found out iconv was the problem
    my php version is 7.1.16
    anyway this solved my problem since my LS is reading apache settings
    Code:
    yum install ea-php71-php-iconv
     
    Last edited: May 6, 2018
    NiteWave likes this.

Share This Page