laravel 5 ,requested url was not found on this server? - apache

I am trying to upload my laravel 5 project on Apache/2.4.7 (Ubuntu) Server at xxx.xx.x.xx Port 80.
When i browse my site using xxx.xx.x.xx/project/public , landing page is working fine.
But when i tried to log in , it throws this error ,
The requested URL xxx.xx.x.xx/project/public/auth/login was not found on this server.
but when i tried this xxx.xx.x.xx/project/public/index.php/auth/login it throws View [app] not found.
I tried using RewriteBase on htaccess file also edited public/index.php file and changed these following lines...
require __DIR__.'/../bootstrap/autoload.php';
to require __DIR__.'/../project/public/bootstrap/autoload.php';
and
$app = require_once __DIR__.'/../bootstrap/app.php';
to $app = require_once __DIR__.'/../project/public/bootstrap/app.php';
nothing is working!!
I know this one is older topic but i didn't find solution.
Looking for your suggestions.

Which version of Laravel are you working on? I've got problem with auth on 5.1 LTS. No problem with standard configuration (never touched htaccess or config file).
I can suggest to try a new install with a new Laravel package on your server without modifications and see if it works.
This may help: Laravel 5.1 Authentication documentation

Try to enable Apache rewrite module. Run this in command line:
a2enmod rewrite
and don't forget to restart Apache after.
service apache2 restart

Related

cakephp css/js not load

I am using cakephp 2.6.2 in ubuntu 16.04 . I enabled mod_rewrite in my system. I downgrade php 7 to php 5.6 .In my cakephp program css and js are not loading
<script src="/admin/plugins/jQuery/jQuery-2.1.4.min.js"></script>
it not take the project name along with the src
The project need index.php in the url
Sessions are not working.
I dont know any other configuration is needed in apache
$this->redirect('/notifications/index/');
returns localhost/notifications/index/ instead of localhost/projectfolder/notifications/index/
I got Solution
My .htaccess is not load by apache. I mention "AllowOverride All" in my virtual host configuration. now it is working fine

Does Apache create .htaccess file on startup

Working with Docker and a PHP application. Something (assuming Apache) is creating the following .htaccess file in webroot on container start up.
/var/www/html# cat .htaccess
Deny from all
I delete the .htaccess file and my application works properly. Then shows up again when I start the container. This is a basic Debian Stretch / Apache / PHP 7 image with my PHP code added to it.
Looking for reason or module that is doing this.
Edit: The Dockerfile https://pastebin.com/VDTFYJ0X
Apache is not automatically creating .htaccess files.
I highly assume that your problems is caused by docker.
Try checking your Dockerfile.
The program creating .htaccess file is Composer. Note this issue:
https://github.com/composer/composer/issues/5816
Best to set COMPOSER_HOME to something other than the web root.

Local Apache server doesn't run php file, instead the web browser downloads

My local Apache server doesn't run my php file, instead the web browser downloads it when I try to view it. I'm using LAMP on Ubuntu. Would you help me how I can solve this problem? Thank!
Did you tell LAMP to handle .php files with the php5_module?
Check your current php setting by creating a new php file in the htdocs or www direectory with the following content:
<?php phpinfo(); ?>
This will show you if your webserver can process php files or not

Bitnami redmine change port on Windows

I have an Bitnami Redmine installation on my windows. I access my redmine at http://xxx.xxx.xxx.xxx/redmine. this works well.
Now I want to change the port so that I can access http://xxx.xxx.xxx.xxx:8060/redmine
But when I change my httpd.conf file from my Apache I can't find the redmine homepage.
Did I miss something or does somebody has a solution for this issue?
Are you running under bitnami? if so, there's an extra step of updating this file:
apache2\conf\bitnami\bitnami.conf
maybe this will help you (see item 8) http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI_on_Windows_with_Apache
...
8. Assuming that we will be hosting Redmine under http://localhost/redmine
Edit C:\webserver\Redmine\config\environment.rb file to configure Redmine to work as a sub-URI (Apache configuration is also required and is listed later on in this document).
add the following line at the bottom of the file:
Redmine::Utils::relative_url_root = "/redmine"

Redirect does not work?

I have a problem in the Apache config. On my localhost
return $this->redirect('ex::dashboard');
executes perfectly.
But when I upload the code to the server. It terminates with a blank page.
What could be the reason? I tried to debug.. but with no success.
I have access of the server and checked most of the PHP parameters.
'./configure' '--disable-fileinfo' '--disable-pdo' '--enable-bcmath'
'--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf'
'--enable-libxml' '--enable-mbstring' '--enable-soap' '--enable-sockets'
'--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs'
'--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr'
'--with-gd' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr'
'--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64'
'--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/'
'--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr'
'--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr'
'--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre'
'--with-pic' '--with-png-dir=/usr' '--with-xpm-dir=/usr'
'--with-zlib' '--with-zlib-dir=/usr'
There is one difference in
LocalHost
Server API Apache 2.4 Handler Apache Lounge
Dedicated server
Server API CGI/FastCGI
Will this make a difference?
The code:
https://github.com/nilamdoc/vc.co.uk/blob/master/app/controllers/SessionsController.php#L33
at L33 it should redirect to the dashboard page
I also tried
header('Location: https://' . $_SERVER['SERVER_NAME']."/ex/dashboard");
but it did not redirect
Given the following:
I also tried
header('Location: https://' . $_SERVER['SERVER_NAME']."/ex/dashboard");
but it did not redirect
...this is not a Lithium question.
Are you sure it's even Apache? This:
Server API CGI/FastCGI
...does not seem to indicate.