How can i make laravel routes accessible from phpdesktop chrome? - laravel

I have a laravel 6 application that I want to put into setup form. so i found phpdesktop chrome and copy my app content to phpdesktop www folder. When I start the application with the setup, it shows me the home page, but when I click on a button to access my login page, I receive this error: Error 404: Not Found
File not found.
What can I do to make the routes accessible via the desktop application?
any help would be appreciated. thank you

It was enough to put /index.php at line "404_handler":
"web_server": {
"listen_on": ["127.0.0.1", 62412],
"www_directory": "www/public",
"index_files": ["index.html", "index.php"],
"cgi_interpreter": "php/php-cgi.exe",
"cgi_extensions": ["php"],
"cgi_temp_dir": "",
"404_handler": "/index.php",
"hide_files": []
},

Related

Netlify Redirect not working in my app with React Hooks

Hi i try connect my page in netlify with a service external but i dont now how configurate _redirects I put this:
/api/* http://www.webservice.com/:splat 200
And my app get webservice and put these url https://myapp.netlify.app/api/products
i want that put http://www.webservice.com/api/products
my _redirects is in public folder , my app is developer in react-hooks with webpack
plese someone cant help me,
Put the following in your netlify.toml file:
[[redirects]]
from = "/api/*"
to = "http://www.webservice.com/api/:splat"
status = 200
Then browse to https://myapp.netlify.app/api/products and it'll show you the page at http://www.webservice.com/api/products.

lsapp.test on browser not giving the index page instead localhost/lsapp/public/ gives the home page

I have set up the environment for virtual hosts using Apache. I am facing three problems.
1) I am unable to go to the index page by using lsapp.test on my browser (I have set lsapp.test for 127.0.0.1 and also the same for the localhost. It gives a 404 error.
2) If I go to localhost/lsapp on the browser the whole directory is visible (I assume which means my virtual host is not working as it should be)
3) On the browser, http://localhost/lsapp/public/ leads me to my root.
Web.php is as follows:
Route::get ('/', function() {
return 'Hello World';
});
Gives me Hello world on the browser as expected. BUT the problem is if I try to navigate to my about page through
Route::get ('/about', function() {
return 'about';
});
It gives 404 error. I have been breaking my head for the past 2 days. This could be a simple problem but so far I haven't figured out a solution.
I have checked the httpd-vhosts.conf file in Apache folder and hosts file in System32>drivers>etc if I have done the right settings and it looks fine.
This question does not require codes
lsapp.test on the browser must go to the home page. Also, I must be able to browse other pages.
Your document root should be lsapp/public/ and index.php must catch all request.
Apache Vhost
DocumentRoot /var/www/html/your-project/public
See:
https://laravel.com/docs/master/deployment
https://www.howtoforge.com/tutorial/install-laravel-on-ubuntu-for-apache/

phpdesktop - ajax request - resource not found

I am attempting to create a simple application with laravel and wrapping it in phpdesktop to use locally without the need of a webserver(aside from the built-in php server).
Everything works great except this one thing.
If I launch the app.exe, i get 404's when vue/axios requests data from an endpoint, eg: /api/resource.
However, If I open the app in a browser while running the php server (localhost:8000) the resource is found and loaded correctly.
Is there a way around this? Or is this simply how phpdesktop is supposed to work?
Here are a few relavant settings from 'settings.json'
"web_server": {
"listen_on": ["127.0.0.1", 0],
"www_directory": "www/public",
"index_files": ["index.html", "index.php"],
"cgi_interpreter": "php/php-cgi.exe",
"cgi_extensions": ["php"],
"cgi_temp_dir": "",
"404_handler": "/index.php",
"hide_files": []
},

How to call sitemap.xml in codeigniter application

i have added sitemap.xml file to my codeigniter project.
And i call it on my localhost like that : http://localhost/demo/sitemap.xml
it runs without any issue.
But when i run it on live server http://example.com/demo/sitemap.xml
it says 404 page not found.
What is issue ?
you need to add below things in your config/routes.php file
$route['sitemap\.xml'] = 'demo/sitemap'; // your navigation path i.e. your controller_name/function_name

Laravel Object not found Error 404

The laravel project runs at another system with a fixed ip.
If I access the project on another computer via this line:
http://61.211.45.158/appi/public/auth/login
(changed to original ip for privacy)
it works so far but if I login the url does change to this:
http://61.211.45.158/auth/login
and I get the error
Object not found ... 404
The laravel project works if I call it locally via localhost....
I do not know why this is happening really big thanks for any help.
EDIT:
I removed the authentification and somehow it show the page now just without the login and register, does anyone know why?
I commented this line:
Route::group(['middleware' => 'auth'], function ()
{
You have wrong web server configuration on the remote machine. Web server should be pointed to a public directory, for example /home/someuser/appi/public, but not to /home/someuser/. Edit Apache config file (do not edit .htaccess), you should have similar lines in it:
DocumentRoot "/path_to_appi/appi/public"
<Directory "/path_to_appi/appi/public">
Then restart Apache to make everything work.

Resources