yii2 framework site on Windows 10 localhost - deployment issue - yii2

I've received an yii2 project zip archive and try to deploy the project on localhost(Windows10/Apache).
I've already install all the dependencies(composer install) and now try to open the site: using "yii serve" in cli and http://localhost:8080/ at my browser.
But something's wrong with it, I can see just html page which isn't working correctly, no js an css are being loaded. If I open the page source(Ctrl+U) I can see that there's no <header></header> tag with js and css at all. See the image attached:
Also, I've created a virtual host for the purpose but the result is the same.
I noticed that if I type http://localhost:8080/login?redirect=%2F it's loading all the js and css but saying: "Page not found".
Also, here is CMD console screenshot:
What can be the issue and how to get it working?
Thanks for advance!

Related

Anchor tag working locally, but not when deployed

Weird problem I'm running into... This anchor tag
<a target='_blank' href='jresume.pdf'>Resume</a>
is working fine locally. Opens a new page and loads my pdf file.
But for some reason when I deploy my site to surge.sh the link no longer works and gives me this error "No webpage was found for the web address: http://sitename.surge.sh/jresume.pdf"
if anyone could help that'd be great. Thanks
The first step I would take is to make sure the file is in the right place on your web server (have you actually uploaded the file to your web server?). I guess that'd be in the same folder as your index.html or the same folder as whatever html file is linking to it.
If that's not the problem I'd try changing href='jresume.pdf' to href='./jresume.pdf' and seeing if it makes a difference.

How to add a style.css to React/Laravel app?

I'm building a React/Laravel app. However, when I tried to style the layout, I found that I cannot edit in public/css/app.css since every time I run the npm run dev command, the changes I've made disappear from the app.css.
Therefore, I created a style.css but I was confused about whether I should put the style.css into the public folder or resources folder. Moreover, after looking at Laravel docs, this link said that I should add a code to webpack.mix.js. So here's what I wrote
.styles('public/css/style.css', 'public/css/all.css');
adding this to the last part of the whole code:
mix.react('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.styles('public/css/style.css', 'public/css/all.css');
After running npm run dev, I refreshed the page and the page is still not showing the changes from style.css.
Here is my repo: https://github.com/kikidesignnet/hotelreviews and my website which I'm editing: http://immense-beach-76879.herokuapp.com/
What am I missing?
Add the all.css file to your main layout.

Upload to Firebase Hosting not working correctly

I've just finished building my first web app using AngularJS and Firebase for my real time database. When I run it on localhost everything I want it to do is working good for me. However, when I've loaded it up to Firebase Hosting and gone and opened it, the files haven't loaded correctly.
My CSS file is blank and both my app.js and maincontroller.js files have all of my index.html code in them instead of the JavaScript code that should be there.
Here is a link to my app so you can see what I am talking about.
I've been unable to find any answers for what is causing this/what I'm doing wrong. If anyone is able to help it'd be greatly appreciated.
Here's your problem, from the source of index.html:
<script src="projects/web\ design/in.out/public/app.js"></script>
<script src="projects/web\ design/in.out/public/maincontroller.js"></script>
You have local path names in your <script> tags when they need to be relative to the public directory. These should be changed to /app.js and /maincontroller.js respectively.

Brackets - Live Preview not working

I found this awesome program(html editor) called Brackets and it's by Adobe.
Now reason why i got the editor was because i wanted to Live Preview PHP code, but i found out later that i needed a Wamp Server.
Now, i was in the mood of making an about page but i couldn't live preview. Live Preview Base URL is empty, and when i try to live preview, i get this: > http://puu.sh/aDkET/4209ec1192.png < and the lightning bolt is half orange(i heard it needs to be red to work). I have tried the lot... Entering as Live Preview Base URL to http(semicolon)//localhost:(insertporthere)/ <-- Wamp Server, tried only localhost, left it empty, I don't know how to make this work.. I am stuck and i basically need real preview..
Please, please help me! D: I have searched the internet looking for solutions, but no. If you can, a step-by-step tutorial would be much appreciated :)
Kind regards,
- PiguFilms
The Live Preview "Base URL" is the localhost URL that corresponds to the root folder of your project. Brackets uses this to map from a local path on disk to the server URL which serves up that same file: it takes the HTML file's path relative to the project root, appends that relative path onto the Base URL, and then launches the resulting full URL in Chrome.
So, for example:
If your page is at http://localhost/myapp/page.php and the page.php file is in a "myapp" subfolder of your project, your base URL is just http://localhost/.
If your page is at http://localhost/myapp/page.php and the page.php file is in the root of your project, your base URL is http://localhost/myapp/ (this way the path is "/page.php" relative to both bases).
If you think you have the Base URL set correctly but it's still not working, try going to the same URL manually in your browser to make sure your server is operating correctly.
More details on using Live Preview with your own local server can be found here: https://github.com/adobe/brackets/wiki/How-to-Use-Brackets#lp-custom-server.
although #ytpete's answer is the right choice for your problem but you need to do, as i say, first. In simple words, go to file(in Brackets), click open folder and now make the project directory exactly same as your local host server for php files i.e. C:\Program Files\Ampps\www\phpFiles (i am using Ampps and here 'phpFiles' is a subfolder inside which relies my php file and also html file too). Now you can follow steps shown by ytpete and you are set to live preview of your php file.
I had this problem as well. What I did was simply goto File->Open Folder... it all worked after all the necessary files were loaded into Brackets.
If you are using windows try running brackets "As administrator", worked for me
I had this same issue once I installed Xampp. This video resolved it for me. Essentially just select, File > 'Enable Experimental Live Preview' should have a check mark.
Make sure you don't have an internet bandwidth limiter (such as NetLimiter) running while using Brackets' Live preview.
I have just fixed this issue for myself, I had 'Experimental Live Preview' ticked under file. I unticked it and now it accepts my 'http://localhost/mywebsite' URL when I go to live preview.
This worked for me. I restarted my system and then unchecked "enable experimental live preview" in file.
this worked for me, and i don't remember where i saw it, but go to : cd $HOME/.local/share/applications and delete everything chrome related.
This worked for me, and i didn't dare to use live preview again.
On Ubuntu 16.04 LTS and Chrome Version 61.0.3163.100 (Official Build) (64-bit)
Put your files in the same folder where you have index.html file
I have selected the option called "reload with extension" from Bracket's debug menu and that resolved live preview issue. More details can be found here.
For everyone, this problem can be resolved by following steps:-
On menu bar, go to File --> Open Folder (folder which have your html file for live preview)
Select Folder
Select your html file from left side bar for live preview
Click on bolt icon on right (preview button)
All it melts down to the fact, that you need that folder(which have your file) selected to view your output in live preview.
Let me know, if it helps someone. :)
It is because it doesn't find the 'html' file. Live preview basically needs html file to run it .In my case, I have a project made in php , my file name is index.php,I renamed it to index.html and it works like charm :)

ServiceStack.Swagger doesn't work with ServiceStack.Razor

I've been playing with ServiceStack lib's for a couple of weeks and seems found an issue.
When I download an example project for Swagger-UI from github everything works just fine until I add RazorFormat feature. Then I get "Handler for Request not found" error when trying to view localhost:50001/swagger-ui/index.html (which was previously working).
So how to use both: swagger and razor?
I tried to rename index.html to index.cshtml to make razor engine deal with this file. The page was working but no JS, and no CSS downloaded, so it wasn't useful much.