CodeIgniter 4 - Controller not Found - codeigniter-4

this is the first time I use Codeigniter 4
I'm already installed codeigniter 4 with composer or manual
already copy index.php and .htaccess to root when manual install and run
already run with php start spark serve too
already set baseurl
welcome_message is success run when I Write in URL localhost:8080 or localhost/ci4
but when I write in URLlocalhost:8080/home/index with spark serve, show 404 - File Not Found
and when I write in URL localhost/ci4/home/index still show 404 - File Not Found
anyone please help me....

Go into Your_Project_Folder > index.php
Change, FCPATH . '../app/Config/Paths.php' to FCPATH .'app/Config/Paths.php'

I'm already have solution, in file Routes.php I set $routes->setAutoRoute(true);
but i saw in reference no one use this trick and they can call the controller

Related

Created cPanel subdomain, files inside the subfolder showing 500 error

I have setup a subdomain in cpanel like market.domain.com. The document root for this is /public_html/market/. I have places PHP files here
/public_html/market/info.php - this is working
/public_html/market/api/info.php - not working
any help for this will be much appreciated.
TIA
500 internal server error
You need to check 3 things:
Check if there is any .htaccess file in the api or market directory. If yes, please rename the .htaccess file to .htaccess.original and see if the sub domain URL is working. If its working, then review the code in the .htaccess file.
Check the directory permission / ownership to see if its correct.
Check the error logs to find out exactly whats causing the problem.

deployment of react.js application to apache server via react-scripts

I'm quite newbie in react , and, even I have seen similar answers in stackoverflow and google, I can't make it work.
I have created an application via 'react-scripts' , and it worked awesome (just npm start . Nothing fancy).
My problem arrives when I try to deploy this application in my Apache server .
1) I execute 'npm build' . Build folder is created with (I guess ) a deployable version .
2) I copy this build folder to my Apache server and, when I try to access, I see the head and the tittle, but no content. Everything white .
I receive this message after 'npm run build' :
The project was built assuming it is hosted at the server root.
To override this, specify the homepage in your package.json.
For example, add this to build it for GitHub Pages:
"homepage": "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
I guess 'serve' is a http server, but I want to deploy my app in Apache . As I understand, should be enough to copy to Apache folder . There's something I'm missing . Could you help me, please ?
step 1: create a .htaccess file in public folder with the following content
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
step 2: execute npm run build
step 3: copy files from build folder to document root of Apache
you need to make sure mod_rewrite is enabled, before using a .htaccess file.
In ubuntu, execute the command sudo a2enmod rewrite
In CentOS 7, open /etc/httpd/conf/httpd.conf file, Locate the <Directory /var/www/html> section and change the AllowOverride directive from None to All
Check here https://github.com/mgechev/angular-seed/wiki/Deploying-prod-build-to-Apache-2
reloading pages, besides root, and deep linking will cause 404
errors... The reason is that all Angular2 routes should be served via
the index.html file.

Can't access files on Magento root

I am looking to install an SSL on my domain name and in order to do so I need to upload a .htm file to the root and access it via the browser, but when I do so, I keep getting a 404 error - this is with any .html page on the root - nothin shows up.
I have edited my htaccess file as well as deleting it all together and still no luck.
The file i'm trying to reach is: http://www.elmershardware.co.uk/xtt5ughh.htm
If someone could help point me in the right direction of fixing this I'd be really appreciative
Thanks
G
I think there is nothing to do with .htaccess. It's something related with your apache conf.
In your apache configuration file check if in DirectoryIndex appears
index.htm as a entry, add it if it doesn't appears and restart apache. Then , try again

How can i get mod_rewrite and .htaccess working with cakephp?

I'm trying to get cakephp working locally on my mac - yosemite. I have apache and php working locally in my /~user/Sites directory... I can hit a php ini file ok and have an install of wordpress in another directory.
I've hooked it all up apart from getting the urls rewriting... I followed the steps on the cake site:
http://book.cakephp.org/2.0/en/installation/url-rewriting.html
Now all I get is 404 not found!.
The three .htaccess files have the default content with an additional RewriteBase pointing to the folder its installed in, in my Sites folder.
Any ideas what I'm doing wrong? I've read the other posts on this and none of them helped!
Thanks
First, confirm mod_rewrite is enabled by (on command line):
# a2enmod rewrite
If it just got enabled using the command above, restart apache:
# /etc/init.d/apache2 restart
These types of errors should hit your error.log .. while trying to load the site, hold the error log open:
# tail -f /var/log/apache/error.log
and try to access your page again.
If this doesn't help you solve the problem, paste in your rewrite rules so we can take a peak.

yii, Development and URL issues

We have our server which runs the site at 173......54/
For development we want to have a copy of the code that can be tested at 173.....54/~me/site
When I install a copy of Yii and the code at ~me/ folder and access 173.....54/~me/site I am able
to see the newly installed index html. However, if I try to move to 173.....54/~me/site/book or a user register page or any other page the other (main) Yii application reads the code as a link not found instead of the development Yii application.
Am I supposed to update a the htaccess file to ignore requests within /~me ? If so how should it look? Or am I missing something?
Thanks again!
No need to make ignore in other .htaccess, the dev site .htaccess will take care of it.
In your index.php at the root of your dev site you need to point $yii at your Yii framework/yii.php
and then in the .htaccess in the root of your dev site you need to point RewriteBase to your dev site root.
Also make sure you point to the correct configuration file corresponding with your application in index.php

Resources