Installation problem on localhost dev-environment


I tried it a lot , once in a while for the last couple of months, but I havn’t been able to get a running installation of silverstripe 4.x on my local dev-machine (linux, apache, php7.1 / 7.2, everything fine…):

For all my current projects with SS3.x I simply have my project-folder inside my www/projecttitle Directory an can access it by the URL http://localhost/projecttitle

But with SS4.x after installation the URL changes to http://localhost/dev/build - I haven’t found any solution to get SS4.x running - so I continue using SS3.7 for all projects

I bet there has to be a simple solution…
Thank You !! Hendrik

I don’t know if this will solve your issue, but I’ve had issues with url’s like http://localhost/mynewsite. Not just installation issues, but path issues as well. For me, and I have a local dev setup like yours, I just add virtual hosts for all my sites.

Apache.conf file:

<VirtualHost *:80>
    DocumentRoot /var/www/html/mynewsite
    ServerName mynewsite
    <Directory /var/www/html/mynewsite>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted

/etc/hosts mynewsite

Then I can use URL’s like this:

And that solved most of my installation and pathing issues.

Just wanted to add a tip here. I have all of my local websites in one directory (~/Sites) so I name each site directory according to the host name I want to use (e.g. ‘companyname.localhost’) and then I have a simple PHP script that loops through the Sites folder and spits out Apache configuration as per above for each one. Then whenever I add a new site I can just overwrite my configuration with the output of that script and update my virtual hosts settings really quickly. That same php file generates a link to each of my local sites and spits out the results of phpinfo(), so I can see a lot of info about my local environment in one place.

I guess I could make the vhosts update a one line effort by writing a bash script to do the updating but I’m not convinced it’s worth the time :grinning_face_with_smiling_eyes:

1 Like

Yeah!.. Thank You, I totally forgot to add the “hosts” entry… !