How to change www folder to public_html

romal
Member | 16
+
0
-

At my hosting root folder named public_html.
Is it possible to make nette work with public_html instead www?

MajklNajt
Member | 498
+
0
-

I think it should work override wwwDir parameter in App\Bootstrap:

$configurator = new Configurator;
...
$configurator->setTempDirectory(__DIR__ . "/../temp");
$configurator->addParameters(["wwwDir" => "public_html"]);
David Grudl
Nette Core | 8228
+
0
-

It should work without any configuration. Is it not working?

fvottus
Member | 5
+
0
-

It should work just fine, just put the other folders (app, temp, log etc..) outside of public_html and put the index.php (and other public files that are normally in www) to the public_html folder.
Make sure the app can read/write in temp & log folders.

Also, if there's something wrong and you don't see “Tracy couldn't log this error”, you should be able to see the problem in the log folder.

Last edited by fvottus (2020-06-05 17:36)

romal
Member | 16
+
0
-

David Grudl wrote:

It should work without any configuration. Is it not working?

I didn’t know that it was possible and therefore I didn’t even try :)

chemix
Nette Core | 1310
+
+1
-

In my case, I just renamed the default folder “www” to folder “public” and it worked. All others folders are the same.

https://github.com/…nettecamp.cz

fvottus
Member | 5
+
-1
-

chemix wrote:

In my case, I just renamed the default folder “www” to folder “public” and it worked. All others folders are the same.

https://github.com/…nettecamp.cz

Yes, it should work, as the main index.php is (most of the times) just requiring the autoload.php and calling a function in a class (by default App\Bootstrap::boot()).

Moreover, as @MajklNajt suggested, I'd also suggest adding $configurator->addParameters(["wwwDir" => "public_html"]);, but it's not neccessary.