Laravel second app show error. While the first app is busy and running some kind of big loop in first app.


  • | 496 points

    Hi,
    I am running some code on my first app which is sending data to server and update the local database.
    This process take too much time.

    During this time i am not able to run 2nd Laravel app. Slim framework app is also showing 404 page.
    After stopping the process in first app. All other app start working.


  • administrators
    | 66215 points

    @shah : If you use Nginx, you can increase the number of PHP Upstream Processes.
    Here's how:

    1. Open usr\laragon.ini (Menu > Laragon > Settings file: laragon.ini)
    2. Put Upstream=5 under [nginx] section
    [nginx]
    Upstream=5
    

  • | 496 points

    @leokhoa Thank you @leokhoa ! But it is still not working. I have done the above steps as you said and restart laragon after that. But it is still not working. here is my laragon.ini file
    [nginx]
    Version=nginx-1.10.1
    Use=-1
    DocumentRoot=D:
    Upstream=5


  • administrators
    | 66215 points

    @shah : Did you use localhost or pretty urls?
    If you use app1.dev (for the long running process) and (app2.dev for other) it should work. Otherwise, you can try to increase the Upstream to larger value (10). I don't think your app1.dev will hold all 10 PHP processes.


  • | 496 points

    @leokhoa Yes i am using pretty urls. And sorry! i am using apache(Apache httpd-2.4.25-win32-VC14). So i think that's why Upstreams is not working.

    [apache]
    Version=httpd-2.4.25-win32-VC14
    Use=-1
    DocumentRoot=D:
    Port=80
    SSLEnabled=0


  • administrators
    | 66215 points

    @shah : Oh, that's the reason why you still have problem. Upstream works only for Nginx, it will create separate PHP processes to serve other requests so you will not see your application blocking. Just enable Nginx in (Preferences > Services & Ports) to see the result.


  • | 496 points

    @leokhoa I am not able to change it. The option is already checked but also disabled.


  • administrators
    | 66215 points

    @shah : Check if you have Nginx at bin\nginx. Otherwise you can download nginx and put it there:
    http://nginx.org/download/nginx-1.12.1.zip

    On laragon.ini, remember to update your Nginx version.


  • | 496 points

    @leokhoa I got the following error
    Service Nginx can not start. Reason:
    ------------------------------------------------------------
    'C:\laragon\bin\nginx\temp\nginx' is not recognized as an internal or external command, operable program or batch file.


  • administrators
    | 66215 points

    @shah : I wonder why temp there?
    You should have a directory structure like this:

    -- C:\laragon\
        -- bin\
             -- nginx\
                 -- nginx-1.12.1\
                     -- nginx.exe
                     -- conf\
                     -- temp\
    

  • | 496 points

    nginx has been installed and running on port 8080 . But nothing happens. I am still getting the same error on my second app.
    here are the laragon.ini configration for nginx

    [nginx]
    Version=nginx-1.12.1
    Use=-1
    DocumentRoot=D:\
    Upstream=10
    SSLEnabled=0
    Port=8080


  • administrators
    | 66215 points

    @shah : Are you sure?
    Suppose you use http://app1.dev on Apache2,
    You can use http://app2.dev:8080 on Nginx

    I don't know why your app2 still have error.


  • | 496 points

    @leokhoa Ohh Sorry! I was not accessing it on port 8080. Now i am able to access the site but the app was redirected to Document Root: C:/laragon/www. When i change root property to "D:/" in Nginx > site-enabled > 00-default.config Now it showing this error

    nginx:[emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 32


  • | 496 points

    Thank you @leokhoa . The problem has been fixed after adding the below line to

    server_names_hash_bucket_size  64;
    

    To bin\nginx\nginx-1.12.1\conf\nginx.conf

    http {
    	....
    	....
            server_names_hash_bucket_size  64;
    }

  • administrators
    | 66215 points

    @shah : I'm glad to hear your issue has been fixed :) Cheers!


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.