advanced-php-mvc-blog
advanced-php-mvc-blog copied to clipboard
Nice project, but not work
Hi and thanks for your project, but unfortunately it doesn't seem to work. This is the problem it gives
and the links do not work and always refer to the home by adding a double slash.
For example, if I click on login it results:
www.mvc3.local//login
with a double slash form www.mvc3.local
and login.
See the screenshot.
I have tested with many php version: from 5.6.40 to 8.0.6
Hello adrix71,
It doesn't seem to me the error message from your screenshot.
I would recommend using xampp instead of wamp.
Put your current code on a gist or a repository to check it.
Also install latest version of it.
Hello and thanks for the reply.
To tell the truth I have not made any changes to the code, but I only installed the version present in your repository on github; I suppose it is the most up-to-date version.
As for xampp unfortunately it is not possible for me to install it and I have to use wampp for many other reasons.
What could be the cause of the fact that only the homepage works?
What happens when you manually change the url to the login route?
I had thought about it too and it was the first attempt, but nothing changes even by manually setting the url
I just cloned the repository and imported the database associated with it and it works fine with me.
I did the same thing by cloning the repository and importing the database, but for the second time it gives me the same problem.
I don't really understand what it can come from. Do you have to recommend some version of PHP and Apache in particular? Have you ever seen those.
Try using version 7.4.
Also i can not see any error message in that trace list.
What does the home page you've look like?
try this
/**
* Prepare url
*
* @return void
*/
public function prepareUrl()
{
$script = dirname($this->server('SCRIPT_NAME'));
$requestUri = $this->server('REQUEST_URI');
if (strpos($requestUri, '?')!==false) {
list($requestUri,$queryString) = explode('?',$requestUri);
}
$this->url = rtrim(preg_replace('#^'.$script.'#', '' , $requestUri), '/');
if (! $this->url){
$this->url = '/';
}
$this->baseUrl=$this->server('REQUEST_SCHEME') . '://'.$this->server('HTTP_HOST') . $script .'/';
}