A
A
Alexander2017-01-14 10:54:34
symfony
Alexander, 2017-01-14 10:54:34

How to set up apache php7 for a site on symphony3?

I can’t configure the server correctly
now the contents of the app.php file are sent to the browser,
I just haven’t tried anything, tell the teapot, otherwise the hysteria begins - a few days
the Apache settings are down the drain

<VirtualHost **.***.***.154:8080>

    ServerName mydomain.com
    ServerAlias www.mydomain.com
    ServerAdmin [email protected]
    DocumentRoot /home/admin/web/mydomain.com/public_html/web
    ScriptAlias /cgi-bin/ /home/admin/web/mydomain.com/cgi-bin/
    Alias /vstats/ /home/admin/web/mydomain.com/stats/
    Alias /error/ /home/admin/web/mydomain.com/document_errors/
    #SuexecUserGroup admin admin
    ErrorLog /home/admin/web/mydomain.com/logs/apache.error.log

    <FilesMatch \.php$>
        SetHandler proxy:fcgi://127.0.0.1:9000
    </FilesMatch>

    <Directory /home/admin/web/mydomain.com/public_html/web>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI

        Require all granted

        php_admin_value open_basedir /home/admin/web/mydomain.com/public_html:/home/admin/tmp
        php_admin_value upload_tmp_dir /home/admin/tmp
        php_admin_value session.save_path /home/admin/tmp
    </Directory>
    <Directory /home/admin/web/mydomain.com/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid admin admin
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID admin admin
    </IfModule>
</VirtualHost>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OnYourLips, 2017-01-14
@OnYourLips

Forget Apache like a bad dream.
Here is /etc/nginx/sites-available/default:

server {
    listen 80;
    root /home/ubuntu/my-symfony-project/web;

    location / {
        index app.php index.php index.html;
        try_files $uri /app.php$is_args$args;
    }

    location ~ \.php {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question