deploy symfony 4.2 project to shared hosting by filezilla
i have a project that build on with Symfony 4.2. I want deploy this project to a shared hosting. But on symfony documentation, there is nothing about it clearly.
I deployed all my project into hosting under public_html.
But probably panel does not find the index.php. On cpanel, i can not change the document root.
current document root: public_html
project folder structure
my index.php under public folder.
<?php
use AppKernel;
use SymfonyComponentDebugDebug;
use SymfonyComponentHttpFoundationRequest;
require dirname(__DIR__).'/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ??
$_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies),
Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ??
$_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool)
$_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Can someone help me about this issue?
symfony cpanel symfony4 shared-hosting
add a comment |
i have a project that build on with Symfony 4.2. I want deploy this project to a shared hosting. But on symfony documentation, there is nothing about it clearly.
I deployed all my project into hosting under public_html.
But probably panel does not find the index.php. On cpanel, i can not change the document root.
current document root: public_html
project folder structure
my index.php under public folder.
<?php
use AppKernel;
use SymfonyComponentDebugDebug;
use SymfonyComponentHttpFoundationRequest;
require dirname(__DIR__).'/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ??
$_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies),
Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ??
$_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool)
$_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Can someone help me about this issue?
symfony cpanel symfony4 shared-hosting
You will waste a lot of time deploying on a shared hosting. Symfony is not meant for that even it is possible. There are very cheap virtual private servers where you will full control of deployment. (and to stick with good practices)
– COil
Dec 29 '18 at 20:01
@COil Yes, i know that but my customer wants this way.
– onurkaya.
Dec 29 '18 at 20:04
have you tried to change .htaccess file in the root of project ?
– hous
Dec 29 '18 at 20:05
@hous I did not. I just upload all my files under public_html.
– onurkaya.
Dec 29 '18 at 20:17
add a comment |
i have a project that build on with Symfony 4.2. I want deploy this project to a shared hosting. But on symfony documentation, there is nothing about it clearly.
I deployed all my project into hosting under public_html.
But probably panel does not find the index.php. On cpanel, i can not change the document root.
current document root: public_html
project folder structure
my index.php under public folder.
<?php
use AppKernel;
use SymfonyComponentDebugDebug;
use SymfonyComponentHttpFoundationRequest;
require dirname(__DIR__).'/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ??
$_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies),
Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ??
$_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool)
$_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Can someone help me about this issue?
symfony cpanel symfony4 shared-hosting
i have a project that build on with Symfony 4.2. I want deploy this project to a shared hosting. But on symfony documentation, there is nothing about it clearly.
I deployed all my project into hosting under public_html.
But probably panel does not find the index.php. On cpanel, i can not change the document root.
current document root: public_html
project folder structure
my index.php under public folder.
<?php
use AppKernel;
use SymfonyComponentDebugDebug;
use SymfonyComponentHttpFoundationRequest;
require dirname(__DIR__).'/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ??
$_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies),
Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ??
$_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool)
$_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Can someone help me about this issue?
symfony cpanel symfony4 shared-hosting
symfony cpanel symfony4 shared-hosting
asked Dec 29 '18 at 17:59
onurkaya.onurkaya.
185
185
You will waste a lot of time deploying on a shared hosting. Symfony is not meant for that even it is possible. There are very cheap virtual private servers where you will full control of deployment. (and to stick with good practices)
– COil
Dec 29 '18 at 20:01
@COil Yes, i know that but my customer wants this way.
– onurkaya.
Dec 29 '18 at 20:04
have you tried to change .htaccess file in the root of project ?
– hous
Dec 29 '18 at 20:05
@hous I did not. I just upload all my files under public_html.
– onurkaya.
Dec 29 '18 at 20:17
add a comment |
You will waste a lot of time deploying on a shared hosting. Symfony is not meant for that even it is possible. There are very cheap virtual private servers where you will full control of deployment. (and to stick with good practices)
– COil
Dec 29 '18 at 20:01
@COil Yes, i know that but my customer wants this way.
– onurkaya.
Dec 29 '18 at 20:04
have you tried to change .htaccess file in the root of project ?
– hous
Dec 29 '18 at 20:05
@hous I did not. I just upload all my files under public_html.
– onurkaya.
Dec 29 '18 at 20:17
You will waste a lot of time deploying on a shared hosting. Symfony is not meant for that even it is possible. There are very cheap virtual private servers where you will full control of deployment. (and to stick with good practices)
– COil
Dec 29 '18 at 20:01
You will waste a lot of time deploying on a shared hosting. Symfony is not meant for that even it is possible. There are very cheap virtual private servers where you will full control of deployment. (and to stick with good practices)
– COil
Dec 29 '18 at 20:01
@COil Yes, i know that but my customer wants this way.
– onurkaya.
Dec 29 '18 at 20:04
@COil Yes, i know that but my customer wants this way.
– onurkaya.
Dec 29 '18 at 20:04
have you tried to change .htaccess file in the root of project ?
– hous
Dec 29 '18 at 20:05
have you tried to change .htaccess file in the root of project ?
– hous
Dec 29 '18 at 20:05
@hous I did not. I just upload all my files under public_html.
– onurkaya.
Dec 29 '18 at 20:17
@hous I did not. I just upload all my files under public_html.
– onurkaya.
Dec 29 '18 at 20:17
add a comment |
1 Answer
1
active
oldest
votes
I have a symfony4 application running under shared hosting ,so try this configuration in the .htaccess
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/index.php [QSA,L]
</IfModule>
for assets try this in framework.yaml
assets:
base_path: '/public'
Thanks, it seem works. But project does not find my css, js, images files for now.
– onurkaya.
Dec 29 '18 at 20:24
I have edited my response
– hous
Dec 29 '18 at 20:27
base_path does not work, just uploading all files again maybe it works.
– onurkaya.
Dec 29 '18 at 20:53
i just delete cache and base_path works! thank you.
– onurkaya.
Dec 29 '18 at 21:32
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53972031%2fdeploy-symfony-4-2-project-to-shared-hosting-by-filezilla%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have a symfony4 application running under shared hosting ,so try this configuration in the .htaccess
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/index.php [QSA,L]
</IfModule>
for assets try this in framework.yaml
assets:
base_path: '/public'
Thanks, it seem works. But project does not find my css, js, images files for now.
– onurkaya.
Dec 29 '18 at 20:24
I have edited my response
– hous
Dec 29 '18 at 20:27
base_path does not work, just uploading all files again maybe it works.
– onurkaya.
Dec 29 '18 at 20:53
i just delete cache and base_path works! thank you.
– onurkaya.
Dec 29 '18 at 21:32
add a comment |
I have a symfony4 application running under shared hosting ,so try this configuration in the .htaccess
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/index.php [QSA,L]
</IfModule>
for assets try this in framework.yaml
assets:
base_path: '/public'
Thanks, it seem works. But project does not find my css, js, images files for now.
– onurkaya.
Dec 29 '18 at 20:24
I have edited my response
– hous
Dec 29 '18 at 20:27
base_path does not work, just uploading all files again maybe it works.
– onurkaya.
Dec 29 '18 at 20:53
i just delete cache and base_path works! thank you.
– onurkaya.
Dec 29 '18 at 21:32
add a comment |
I have a symfony4 application running under shared hosting ,so try this configuration in the .htaccess
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/index.php [QSA,L]
</IfModule>
for assets try this in framework.yaml
assets:
base_path: '/public'
I have a symfony4 application running under shared hosting ,so try this configuration in the .htaccess
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/index.php [QSA,L]
</IfModule>
for assets try this in framework.yaml
assets:
base_path: '/public'
edited Dec 29 '18 at 20:27
answered Dec 29 '18 at 20:20
houshous
9361136
9361136
Thanks, it seem works. But project does not find my css, js, images files for now.
– onurkaya.
Dec 29 '18 at 20:24
I have edited my response
– hous
Dec 29 '18 at 20:27
base_path does not work, just uploading all files again maybe it works.
– onurkaya.
Dec 29 '18 at 20:53
i just delete cache and base_path works! thank you.
– onurkaya.
Dec 29 '18 at 21:32
add a comment |
Thanks, it seem works. But project does not find my css, js, images files for now.
– onurkaya.
Dec 29 '18 at 20:24
I have edited my response
– hous
Dec 29 '18 at 20:27
base_path does not work, just uploading all files again maybe it works.
– onurkaya.
Dec 29 '18 at 20:53
i just delete cache and base_path works! thank you.
– onurkaya.
Dec 29 '18 at 21:32
Thanks, it seem works. But project does not find my css, js, images files for now.
– onurkaya.
Dec 29 '18 at 20:24
Thanks, it seem works. But project does not find my css, js, images files for now.
– onurkaya.
Dec 29 '18 at 20:24
I have edited my response
– hous
Dec 29 '18 at 20:27
I have edited my response
– hous
Dec 29 '18 at 20:27
base_path does not work, just uploading all files again maybe it works.
– onurkaya.
Dec 29 '18 at 20:53
base_path does not work, just uploading all files again maybe it works.
– onurkaya.
Dec 29 '18 at 20:53
i just delete cache and base_path works! thank you.
– onurkaya.
Dec 29 '18 at 21:32
i just delete cache and base_path works! thank you.
– onurkaya.
Dec 29 '18 at 21:32
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53972031%2fdeploy-symfony-4-2-project-to-shared-hosting-by-filezilla%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You will waste a lot of time deploying on a shared hosting. Symfony is not meant for that even it is possible. There are very cheap virtual private servers where you will full control of deployment. (and to stick with good practices)
– COil
Dec 29 '18 at 20:01
@COil Yes, i know that but my customer wants this way.
– onurkaya.
Dec 29 '18 at 20:04
have you tried to change .htaccess file in the root of project ?
– hous
Dec 29 '18 at 20:05
@hous I did not. I just upload all my files under public_html.
– onurkaya.
Dec 29 '18 at 20:17