-2

I still cannot understand what happening in my server when i push my code throught the server in /public_html and wanna get the homepage of my application like this:

http:/www.example.com/web/

Server shows me the content of /web (the files and directory that exist inside /web)

and that's happen after i follow step's Command Line to deploy symfony 3 in that link: https://symfony.com/doc/3.1/deployment.html

I Still cannot understand what's happening there!!

any help would be extremely appreciated!

1 Answer 1

1

1-) yum install nginx

2-)service nginx start

3-) Add Nginx configuration into /etc/nginx/conf.d/project_name.conf

server{
    set $web_host "domain_name";
    set $web_root "web_directory";

    server_name $web_host;
    root $web_root;

    location / {
        try_files $uri /app.php$is_args$args;
    }
    # DEV
    # This rule should only be placed on your development environment
    # In production, don't include this and don't deploy app_dev.php or config.php
#    location ~ ^/(app_dev|config)\.php(/|$) {
#        fastcgi_pass 127.0.0.1:9000;
#        fastcgi_split_path_info ^(.+\.php)(/.*)$;
#        include fastcgi_params;
        # When you are using symlinks to link the document root to the
        # current version of your application, you should pass the real
        # application path instead of the path to the symlink to PHP
        # FPM.
        # Otherwise, PHP's OPcache may not properly detect changes to
        # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
        # for more information).
#        fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
#        fastcgi_param DOCUMENT_ROOT $realpath_root;
#    }
    # PROD
    location ~ ^/app\.php(/|$) {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        # When you are using symlinks to link the document root to the
        # current version of your application, you should pass the real
        # application path instead of the path to the symlink to PHP
        # FPM.
        # Otherwise, PHP's OPcache may not properly detect changes to
        # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
        # for more information).
        fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        # Prevents URIs that include the front controller. This will 404:
        # http://domain.tld/app.php/some-path
        # Remove the internal directive to allow URIs like this
        internal;
    }

    error_log /var/log/nginx/project_error.log;
    access_log /var/log/nginx/project_access.log;
}

4-) `chmod -R nginx:nginx /var/www/html/project``

5-) service nginx restartand service php-fpm restart

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.