I have a basic codeIgniter 4 project with no connection to a database. As at now it uses the default config for routing. I have followed the appropriate casing for the Controllers... that is first letter uppercase. The project works fine on local host but returns 404 error on heroku.
404 - File Not Found
Sorry! Cannot seem to find the page you were looking for.
$baseURL is set to the domain
$indexPage is empty
index.php and .htaccess are in the main directory.
Here is a link to the project on github. And here is the project on heroku
Any suggestions on what I should try?
Thanks a lot!
Related
Hello everyone i am new to laravel and i hope someone can help me about my problem. I created a laravel project. After that I import it to cpanel using softaculous. Then, I made some changes base on what i research in the net to avoid showing important file like .env . I created a folder relative to public_html, let say the folder name is 'tamangbilang' where i put almost all of my code except the index.php. Inside my public_html folder, I have another folder named as 'tamangbilang' where my index.php resides. I have followed this instruction https://dev.to/pushpak1300/deploying-laravel7-app-on-shared-hosting-hostinger-31cj the only difference is that I put another folder inside public_html.I also did some changes on the index.php code
require __DIR__.'/../../tamangbilang/vendor/autoload.php';
$app = require_once __DIR__.'/../../tamangbilang/bootstrap/app.php';
Everything is working fine on my login page(my first page) but when I try to login, an error occur.
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
It seems like the connection between routes was lost. I did further testing and I notice that the code is working well only if there is an index.php, before the route in the url. example
http://my-sample-domain.org/tamangbilang/index.php/login
P.S. I don't have access for ssh.
go to bootstrap folder & open cache folder then delete config. after that please check your routes this error basically arises due to routes not found for that go to your project installed on local and write php artisan route: list check if the route is present or not.
I have a PHP Laravel project hosted on Heroku with a Postgresql database and I want to add a Wordpress blog to /blog.
I added in the public folder a blog folder and then copied the last version of WordPress there.
After that, I followed, starting with step 6, this tutorial: http://www.merocode.com/hosting-wordpress-blog-on-heroku-with-support-of-postgres/. I also replaced the wp_config variables with the ones provided on Heroku.
After deploying it to Heroku and trying to test my_site.herokuapp.com/blog I get:
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /app/public/blog/wp-content/pg4wp/core.php(32) : eval()'d code on line 1612
Connecting to your PostgreSQL database without a password is considered insecure.
If you want to do it anyway, please set "PG4WP_INSECURE" to true in your "db.php" file.
Can anyone help me with this problem? Do you know another good tutorial with all the steps that can help me host a WordPress blog to an existing PHP Laravel project?
Thank you!
Laravel and Wordpress should be separated!
This error is not related to Laravel. Check your Wordpress files and versions or your webserver config.
Correct solution:
Create a new config in your webserver and define new routes for /blog and separate your project folders.
I started studying CodeIgniter Web Framework and I am trying to work with PHPStorm 8.0.3 on Kubuntu 14.04. When I unzip CodeIgniter downloaded archive to root Apache folder /var/www/html and go to
localhost/index.php
then it works okay and I see "Welcome to CodeIgniter!" page. Also I
can use
localhost/index.php/welcome/index
and see the same page as it should be.
When I created a new PHP project in PHPStorm and try
localhost:63342/codeignitor/index.php/
then I see welcome page, but if I use
localhost:63342/codeignitor/index.php/welcome/index
then I get 404 page. Also all my own controllers are not available and
cause 404.
I can call my own controller only if I make it default
$route['default_controller'] = 'mycontroller';
I think that this problem occurs because the URL contains name of my project /codeignitor/, but I'm not sure about it. So I need your advice how to set CodeIgniter environment in PHPStorm correctly to solve this problem. Thank you!
Codeigniter uses the URL to determine routing, therefore /codeigniter/index.php/welcome/index and /index.php/welcome/index are not equal paths. I would recommend using one or the other, and adjusting your /index.php and /config/routes.php to accommodate for your desired path.
References:
Codeigniter Subfolder
https://www.codeigniter.com/user_guide/general/urls.html
https://www.codeigniter.com/user_guide/general/routing.html
https://www.codeigniter.com/user_guide/general/environments.html
Just starting with Laravel.
I've installed it on my wamp server and setup a virtual host in apache. The standard home controller works fine. I've installed the scaffold bundle and generated a blog according to the description at the bundle's github page. There was no errors.
I've added Route::controller(Controller::detect()); to my routes.php but none seem to be working. I've tried http://laravel.dev/blog/posts/create and http://laravel.dev/blog/post/create. The scaffold created 3 controllers, users.php, blog/posts.php and blog/comments.php.
laravel.dev is a virtual host pointing with D:\wamp\www\laravel\public as DocumentRoot.
What are the possible issues? Where do I start looking?
Dont use Route::controller(Controller::detect()) - its known to be buggy and causes alot of issue.
Just define each controller individually in the routes.
I suspect you might have to include "index.php" (http://laravel.dev/index.php/blog/posts/create) in your URLs for it to work. This is a default option set in Laravel.
If you would like to turn this off for cleaner URLs, set "index" to an empty string in config/application.php.
You can read more about this in the documentation: http://laravel.com/docs/install#cleaner-urls
Can anyone help me,
i developed my application with Cakephp 2.1, and it works fine on my development server running Centos 5.7. My challenge came when i transfer my application to the lice server to be accessed by on LAN. It states that a missing controller which is not available in my whole application, for example, i named my folder which contains my application and uploaded to the correct folder in Centos, e.g /var/www/html/students and every time i need to access the application states that students controller is missing. I tried to rename my folder to 'mysite' and the errors still remain with mysite controller is missing.
So everytime i changed the name of the folder it states a missing controller for that named folder. I tried to figure out in core.php but cant find the solution.
To change the base directory to say /mysite you will have to modify your 3 .htaccess of cakephp i.e one in installlation folder , second inside the app folder,third inside the webroot folder
try adding:-
RewriteBase /mysite/
Hope this helps!