yunastrian / Rankquirements

Simple application to perform requirement prioritization task
0 stars 0 forks source link

Not Found The requested URL was not found on this server. #1

Open hanizaki opened 1 year ago

hanizaki commented 1 year ago

Hai. I manage to install this application. I am using Netbean IDE. However, when I want to add New Project, filled Project Name, clicked Submit button, it sent to this page http://localhost/project/add and I got error 404 Not Found The requested URL was not found on this server.

Would you please assist me on this?

yunastrian commented 1 year ago

Hi, hanizaki. It is supposedly redirected to Home page after clicked submit button. But, I need some information. Is the project name recorded into the database (You can check it on "projects" table)? In which port the application running?

hanizaki commented 1 year ago

The project name I gave did not record in the "projects" table.

The application is running in port 80. I am using XAMPP where the basic setting is Apache listen to port 80, 443 and MySQL listen to 3306.

I managed to register, and my username and password are recorded in the "users" table. I guess my database migration is not the problem. But I'm not sure yet which part I did wrong.

image

image

image

.env

APP_NAME=Rankquirements
APP_ENV=local
APP_KEY=base64:F/EfXHG5fZM0Ds7ZqKREz2LSsmdcLU8OQHvY3HGphaM=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_yunastrian
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

/config/app.php

'name' => env('APP_NAME', 'Rankquirements'),
'env' => env('APP_ENV', 'local'),
'debug' => (bool) env('APP_DEBUG', true),
'url' => env('APP_URL', 'http://localhost'),

'asset_url' => env('ASSET_URL', null),
'timezone' => 'UTC',
'locale' => 'en',
'fallback_locale' => 'en',
'faker_locale' => 'en_US',
'key' => env('APP_KEY'),

'cipher' => 'AES-256-CBC',
....

/public/.htaccess

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_URI} (.+)/$
# RewriteRule ^ %1 [L,R=301]
RewriteCond %{REQUEST_URI} !^/index.html$
RewriteRule . /index.html [R=302,L]

# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

/config/database.php

....
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel_yunastrian'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
.....

I hope this additional information can give you some idea. Thank you in advance!

yunastrian commented 1 year ago

Thanks for the reply, hanizaki. I think it is about port issue. If the submit button clicked, it must send POST request like this screenshot

image

I used XAMPP too where the Apache listen to port 80, 443 and MySQL listen to 3306. But, I run the application using command prompt with "php artisan serve" command and it run in port 8000.

image

I suggest to run the application on different port (other than port 80). I hope it will solve the problem. But if it's still error, maybe try to edit the routes code.