PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 5, 2022

[FIXED] trying to open a php project using netbeans but error not found appears

 March 05, 2022     php     No comments   

Issue

I'm trying to open a PHP project using netbeans, this project was not created by me, so I move it into htdocs folder, but localhost does not recognize it and this error showed up: (localhost worked properly when I create project myself)

error image

The location of the project is : D:\xampp\htdocs\S21\project21

so I tried this url: http://localhost/s21/project21/index.php and it did open, however without styles. It didn't load stylesheet files.

unformated page

I even edited any location inside the PHP files to the new URL but it's still not working.

any idea about why this happened? And how to fix?


Solution

Your location is : D:\xampp\htdocs\S21\project21, so the correct URL is http://localhost/s21/project21/index.php.

so I tryied this url: http://localhost/s21/project21/index.php and it did open but without style.it didnt load stylesheet files.

You need to change your asset URL :

<link rel="stylesheet" href="http://localhost/s21/project21/your-style.css">
<script src="http://localhost/s21/project21/your-script.js"></script>

You can still use :

<link rel="stylesheet" href="your-style.css">
<script src="your-script.js></script>

But, if you use mod_rewrite eg : you access to http://localhost/s21/project21/another/endpoint, your assets will be not found.

If you use /style.css, it will access to http://localhost/style.css.



Answered By - Wahyu Kristianto
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing