Announcement

Collapse
No announcement yet.

After moving domains 401 Error with api and php error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • After moving domains 401 Error with api and php error

    I moved my installation to a new host. I updated my data/config.php file. When first trying to load the application I got bad server response trying to use the host I.P. address. I changed the text in the data/config.php file to be "localhost". So that seemed to work.

    Then when I try to load the application I get a warning "Auth error". Here are the log errors.

    2017-01-30 14:09:28 Error 76.121.xxx.xxx 401 GET /api/v1/Settings HTTP/1.0 installurl.com/ 289 Apache access
    2017-01-30 14:09:28 Error 76.121.xxx.xxx 401 GET /api/v1/I18n HTTP/1.0 installurl.com/ 289 Apache access
    Before reporting that here, I decided to use the rebuild.php option. When I tried rebuild over CLI it gives me this error

    Code:
    [root@crm httpdocs]# php rebuild.php
    PHP Parse error: syntax error, unexpected ']' in /var/www/vhosts/installurl.com/httpdocs/application/Espo/Core/Utils/Config.php on line 56
    So I thought ok, maybe this has to do with the php 7.1 error. I tried updating from 4.3.1 to 4.4.0 and the same error as above happened. Furthermore, I used rebuild.php via my browser (by comment blocking the cli check in rebuild.php) and checked the error log and it was empty. I cleared my cache as well, although I don't think that has anything to do with this .

  • #2
    Hello
    Check if the file data/config.php is valid.
    4.3.1 was not supported for php 7.1 and there is the fix https://github.com/espocrm/espocrm/c...2c92a5d8afea1a

    Comment


    • #3
      Okay I upgraded this time before I moved and it worked out fine.

      Comment


      • #4

        I can't seem to get my cron jobs working. I setup the cron job in cPanel. It did not run, I checked the jobs logs. There was nothing in the error logs. Then I tried to run the PHP file manually and I got this error again.

        Code:
         [root@crm httpdocs]# php rebuild.php PHP Parse error: syntax error, unexpected ']' in /var/www/vhosts/installurl.com/httpdocs/application/Espo/Core/Utils/Config.php on line 56
        I validated the file it's talking about, there are no errors in the syntax.

        Comment


        • #5
          but .../Core/Utils/Config.php on line 56 does not have ']' in espocrm version 4.4.0...

          Comment


          • #6
            My SSH client didn't have copy and paste functionality and I wrote it wrong. It should be '[' instead.

            Comment


            • #7
              as I understand you, you upgraded espo to version 4.4 on old host. There it works. On the new host you got this error....
              Try to install new espo on new host for test, to check if is everything OK with extensions and server settings.

              Comment


              • #8
                The enviroment is exactly the same (other than being a fresh install) and I still get the error message.

                Code:
                [root@crm httpdocs]# php cron.php
                PHP Parse error:  syntax error, unexpected '[' in /var/www/vhosts/installurl.com/httpdocs/application/Espo/Core/Utils/Config.php on line 56
                Copied character for character this time!

                Here is the install check.
                PHP version 7.1.1 OK
                JSON On OK
                openssl On OK
                pdo_mysql On OK
                zip On OK
                gd On OK
                mbstring On OK
                imap On OK
                curl On OK
                max_execution_time 180 OK
                max_input_time 180 OK
                memory_limit 256M OK
                post_max_size 50M OK
                upload_max_filesize 50M OK
                MySQL version 5.1.73 OK
                Host Name localhost OK
                Database Name espotest OK
                Database User Name espotest OK
                Edit: rebuild.php on cli has the same error.

                Comment


                • #9
                  run this command
                  php -v

                  Comment


                  • #10
                    I tried getting this working through cron, but in the end I had to use a separate method for running the php file. Plesk is way different than cPanel which is where the majority of the trouble originated. Also, the path to cron.php that was given to me by #ScheduledJob page on the crm was different than what I was supposed to put into Plesk. Everything is working fine now, and the crm is much faster with php 7.1.

                    /thread

                    Comment

                    Working...
                    X