Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

raffelustig's avatar

Problem to get my Laravel 9 system to deploy

I have a dynu.com web address shoot.mywire.org and in IspConfig I have created this for my Ubuntu 20.04 server with Apache2. The site needs minimum PHP8.0 so I have added that to PHP Versions in ispconfig.

The site comes up with the resources/views/app.blade.php but only page header and footer shows.

Can be seen here: http://shoot.mywire.org

I wonder what could be the problem?

0 likes
20 replies
Tray2's avatar

Have you read the apache logs?

raffelustig's avatar

@Tray2 access.log, suexec.log or error.log nothing but "other_vhosts_access.log":

shoot.mywire.org:80 192.168.1.1 - - [16/Aug/2022:14:48:21 +0200] "GET /publicviews/navigation HTTP/1.1" 404 2083 "http://shoot.mywire.org/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Safari/605.1.15"
Sinnbeck's avatar

What i supposed to be in the middle? Is it shown by some logic in your code? We cannot help much without knowing anything about your code.

raffelustig's avatar

@Sinnbeck resources/views/app.blade.php:

@include('layouts.header')
<script>
	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
				(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
			m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
</script>

 <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>

	<base href="/..">
	<div ui-view="navigation" class="hidden-print"></div>

	<div class="container-fluid" ng-hide="loadingState">
		<div class="row">
			<div class="col-sm-12">
				@include('alerts.factorymessages')
				<div ui-view="content"></div>
			</div>
		</div>
	</div>

@include('layouts.footer')

I have taken out unnessecary lines.

kokoshneta's avatar

@raffelustig So the entire app view is rendered when the site is opened. There’s just nothing in all the divs, which I’m guessing are supposed to be populated by Vue or Inertia or something like that?

raffelustig's avatar

@kokoshneta Well, this:

	<base href="/..">
	<div ui-view="navigation" class="hidden-print"></div>

and this:

				<div ui-view="content"></div>

If I take out "navigation" and "content" locally it shows the same as on the web.

If I change to PHP8.0 in ubuntu and do "php artisan serve" the system comes up perfect in a browser.

So there is nothing wrong in the Laravel9 code.

raffelustig's avatar

@Sinnbeck Yes, angularjs. But locally everything works. So I don't understand why not on the web.

There is a large file public/js/app.js that contains all the stateProviders and such. But as I said, locally it works fine.

I was thinking that the /etc/apache2/sites-enabled file could be responsible?

Sinnbeck's avatar

@raffelustig My guess is that there is a problem with the angular code there. The url that it cannot, find is that perhaps relevant? Check my previous reply.

Snapey's avatar

So have you content at publicviews/navigation that you have not copied to the server?

raffelustig's avatar

@Snapey In the server everything is there. The complete Laravel 9 application.

There is nothing like "publicviews/navigation".

In the resources/views there is an app.blade.php that contains a call to the navigation blade:

<div ui-view="navigation" class="hidden-print"></div>

That blade is the first that opens up and shall present the navigation bar and the content under it. i.e. between page header and page footer. But they don't.

The navigation blade resides in resources/views/partials.

As I mentioned before the system works fine as "php artisan serve" in a browser on the ubuntu server KDE and Firefox.

Sinnbeck's avatar

@raffelustig you still keep ignoring that url? Open dev tools and check the console and see the error for yourself

Sinnbeck's avatar

@raffelustig open the page in Chrome and hit f12. I suggest you familiarize yourself with this as it's one of the most important tools for a web developer

Sinnbeck's avatar

@raffelustig just a random guess. On local it's /public/views/navigation? It's missing a / on production

And maybe you have /public on local due to a misconfigured web server?

Just a guess as I dont know your app

raffelustig's avatar

@Sinnbeck Ok, thanks. I found out that the publicviews/navigation is part of the angularjs system. So for some reason the <div ui-view="navigation" do not work but we know that already. It's just that the dev tool shows it as an error. So it's not a real address.

In for example public/js/app.js there is a statement like this:

 $stateProvider.state('public', {
        abstract: true,
        views:{
            'navigation@': {
                templateUrl: '/publicviews/navigation'
            }
        }
    });

But I suspect there is something with PHP because I'm running it through IspConfig and their "Additional PHP Versions"-service. I have tried with a Laravel version 7 in the same app and that works but not Laravel 9 for some reason.

raffelustig's avatar

And as I said locally it works like charm. So it's nothing wrong with the application.

Actually, there are two navigation .blade.php.

One resources/views/public/navigation.blade.php. That is the navigation before you're logged in.

After you logged in its the resources/views/partials/navigation.blade.php that is roling.

raffelustig's avatar
raffelustig
OP
Best Answer
Level 2

@Sinnbeck Ok, found out that the Laravel9 system actually was in error, it works fine locally but not on the web. I took another system in Laravel7 and upgraded it to Laravel9 and that works fine on the web. Thank yo all for your help. Now I'm on the right track.

Please or to participate in this conversation.