Announcement

Collapse
No announcement yet.

Cant start EspoCRM application on localhost

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

  • Cant start EspoCRM application on localhost

    I fetched a GIT repo of an existing EspoCRM project. it works as it is hosted and accesable.
    I need to do some work on the app hence i fetched on my local machine (macos) to develop new features (I have never done any EspoCRM stuff)

    After fetch, i uploaded mysql dump, changed DB configs, I checked all php libs to be enabled, version, etc - all seems to be fine.

    If I try to run the app - in the browser i dont see the app.
    If I start the application like `php -S 127.0.0.1:8080` than it shows me the EspoCRM setup screen to set apatche rewrite rules. but its localhost, there is no apatche.
    if i start the application like `php -S 127.0.0.1:8080 -t public` - all I see it copyright text. Also a bunch of missing css/js files (404)
    If I start the application like `php -S 127.0.0.1:8080 -t client` - it seems I see the base layout (header is purple color just as in production (hosted) app) but it says `The requested resource / was not found on this server.` (makes sense since no `index` file in the `client` directory.

    I did try to move it into a mamp (free version) htdocs under `crm` directory, but when accessing it, i see the same `You need to configure your webserver in order to being able to run EspoCRM​` text (same as starting an app via `php -S 127.0.0.1:8080`)

    No other logs/errors are present.
    I also just ftp pulled all the files as a test and its the same deal.

    OS: MacOS Sonoma
    php version: 8.3.7
    php libs (specified in the docs): all enabled
    DB: mysql
    using MAMP (free version)

    I cant find anything in the EspoCRM docs of how to launch the app on a local machine (macos) so I assume I should launch it somehow differently but dont know how.

  • #2
    As you never had worked with espoCRM before, why so complicated already on installing. Besides that it is not possible to follow your steps, it will be much easier, if you simply install a new instance of espocrm in your localhost. In the process, the installation will show up the requirements table and you will see if all pre-requisites of your webserver (localhost) are met.
    When installed, you may copy the custom folders from the GIT repo to your localhost installation (by FTP or copying the data locally). Custom folders are these:
    root -> custom
    root -> client -> custom

    Before installation you have to create a database.

    That is all.

    Comment


    • #3
      I tried that. I also switched from plain php launching to using laravel herd.
      Same issue - all I see it the copyright info on the page.

      Plain new project with those 2 directories moved. And the code in those directories have to be good since its a production code. works on production. So i cant even give any min-reproduction code. its literally just a new project with those 2 working dirrectories.

      But before, i would get 404 errors on css/js files when seeing the copyright info.
      Now i see MIME error

      ```
      myapp.test/:1 Refused to execute script from 'http://myapp.test/client/lib/espo.min.js?r=1713514510' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
      ```

      in the network tab, the `espo.min.js` is literally a html code. the same html code as the copyright info page.
      Regardless of what url i use, all i get for all the files is same html code.

      Comment


      • #4
        I don`t get yet, how you try to install it. If you have a webserver for localhost, you need something like a server stack. A webserver (apache, nginx), PHP and Mysql Database (MariaDB or mySQL).
        If the server is installed correctly, it should have a folder www or htdocs, which is for the espoCRM webfolders, which are in the installation package and will install automatically after you created a database in MySQL or MariaDB, a folder , e.g. espo in the www folder, there inside unpack the espoCRM ZIP. Be aware that in the root of that folder you see all folders of espoCRM, not a folder espoCRM, where inside are all the app folders. All unpacked folders have to be in the root.
        If that is complete, go to a browser and write the address localhost/espo. Then the installation screen should come up and you have to follow the steps. If something in the pre-requisites table is not as necessary, configure it in your server to meet these requirements.

        I installed that way many times, always without problems.

        Comment


        • #5
          Im using laravel herd.
          in the herd folder (same as htdocs for you), i extracted all of the files.
          I created a MySQL database and changed the configs (espoCRM configs) to use it (port, user, password, etc)
          Additionally, i fetched the `custom` and `client` folders via ftp from the prod server and dropped em in.

          I open the browser and go thru the installation.
          And after all of that, my 'main' page (and other pages) are just `© 2023 EspoCRM​` . just that text. thats it.
          In the browser console it says:
          ```
          Refused to execute script from 'http://myapp.test/client/lib/espo.min.js?r=1713514510' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
          ```

          The `myapp.test` is the URL provided by laravel herd (same happens even when using localhost or 127.0.0.1 (localhost IP) when using any other software).
          When inspecting the network tab (chrome) - all of the resources such as JS, fonts, even ico icons, all of content inside is html of text `© 2023 EspoCRM​`​. all of them.
          not a single proper code such as JS.

          Comment


          • #6
            Ok,

            ...and changed the configs (espoCRM configs) to use it (port, user, password, etc)
            don`t do that, this will be filled by configuration during install.

            Additionally, i fetched the `custom` and `client` folders via ftp from the prod server and dropped em in.
            First install everything to have a working empty installation. Test, if it works (obs. the hint in the next paragraph). Then copy these folders to your new installation. If you need data from the former installation, you have to dump the database from that installation (because the data is saved in the database). If you have attachments (attachments is any file, which had been uploaded to the former installation. Images, PDF, other files, Email attachments and alike). All the attachments get an ID, which is referenced in the database. Only by the ID the files will be visible in your new installation. You will find the data in the equally named folder. In doubt, copy that whole folder as well to your new instance.

            The `myapp.test` is the URL provided by laravel herd
            As "herd" is the www folder, I guess that your webserver installation creates a folder under herd with the name myapp.test. Well, then the whole installation should take place in that folder. The www (herd) folder has the subfolders (like myapp.test), which represents the domain-names. So your URL might look like this: localhost/myapp.test. As soon as you had copied all folders from the espoCRM installation package and calling that URL, the installation process should start.

            Keep in mind, that beforehand any installation you only need to create an empty database, all the rest is made during installation. Do not edit any of the config files before installation.
            Well again: The first step will be to install an empty installation. If that works, customizing it by the files from the former installation will work, guaranteed.

            Comment


            • #7
              reading a bit about laravel herd, I have a slight doubt, that it would work for espoCRM. I never used herd.
              Why do you not use the built in web-server of MacOS or a MAMP (MacApacheMysqlPHP) stack?

              Comment


              • #8
                no the url is actually `myapp.test`. the `myapp` it the directory.
                I did try to use mamp with the htdocs folder. i mentioned it in the original post. but had the exact same issue expect instead of mime error, i had 404 errors for css/js etc resources.

                even if i make a full empty project, no additional files no nothing - it still loads nothing on the page and just a bunch of 404 network errors even tho those files exist.
                i tried to run this on my personal windows pc and i had no issues (atleast for empty project). but on my macos work laptop - it does not run.

                Comment


                • #9
                  ok, the I cannot help. I do not work with Mac and my answers here included all, I could think of. Without seeing the system, it is not possible to solve.

                  Comment


                  • #10
                    weirdly, even when trying to install a fresh project, the installer screen itself have issues. icons and css not loading.
                    In the network tab, it spams the `install` url. This is the last requets to `install` controller that the browser tired to do `http://myap.test/client/img/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/install/`
                    What is this bs?

                    Comment


                    • #11
                      I would give up in trying to make it in herd. Do you have a MySQL server installed. Herd only in Pro comes with a MySQL server or you will have to install it manually.
                      There is another webserver for Laravel called Valet. See the problems here: https://forum.espocrm.com/forum/gene...erver-response

                      espoCRm is not a laravel application.

                      Comment


                      • #12
                        yes i have mysql. its not the first ever project i have done just not with espo crm.
                        i dont know why but neither mamp nor laravel herd worked in my case for espo crm.

                        Managed to run it, with help of a college, using docker.
                        I guess running espo o mac, or at least m1 chip mac, is close to impossible. docker is the way.

                        thx for the help tho.
                        I appreciate your time.

                        Comment


                        • rabii
                          rabii commented
                          Editing a comment
                          It is difficult to set up it but it si doable. i have managed to get espocrm to work on Laravel herd

                          if you are still interested i would share all necessary steps on how to get it done.
                      Working...
                      X