Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: getting 404 error when previewing pages with a simple test database (Read 2925 times) previous topic - next topic

getting 404 error when previewing pages with a simple test database

Hi,
I'm just starting off on a trial of the PHPrad solution and I cannot seem to preview the published php pages based on two simple master/detail tables. I get the start page "http://localhost/phptest/" but whenever I click on the link representing the master table
"localhost/phptest/phpmaster" I get a 404 error

I am running on microsoft windows10 with Apache24 web server, Mysql database 8.0 and php 7.4.5. I installed these separately before I found the PHPRAD solution and saw this advice:

"You should make sure you have one of the following localhost servers running on your computer, for example: Xampp, Wampp, Mampp, Lampp or any preferable localhost servers"

I have set the default project directory as C:\Apache24\htdocs\phptest
and the default site address as http://localhost/phptest

Please point me in the right direction if you can.

Thanks, JP

A quick update...I found issue. I needed to set the mod_rewrite on for apache 2.4.

Re: getting 404 error when previewing pages with a simple test database

Reply #1
Hi JohnnyP,

Did you resolved this already?

Thanks,

Re: getting 404 error when previewing pages with a simple test database

Reply #2
 jp26198926,

Yes, I found the problem.

I needed to amend the Apache config file to allow module rewrite as per the php framework documentation:

https://phprad.com/info/api

see section:

Application Entry Point (Index.php)
Mod_Rewrite (.htaccess)

By default Apache server has mod_rewrite enabled, if not mod_rewrite needs to be enabled.

The .htaccess contains the rules for the mod_rewrite which direct all request to the index page except if the request is an actual file or a directory.()

I found this website for the details of what to amend:

https://tomelliott.com/php/mod_rewrite-windows-apache-url-rewrite

Thanks, JP.