Category Archives: artisan

Views do not update after updating files

My view states won't reload on after I do do this stuff. I'm not sure this is a Laravel issue. But I don't know where else to look.

php artisan down
git pull xxxx
composer install

//These things next happen to ensure proper security context.
chown -R apache:apache /var/www/html 

find /var/www/html -type f -exec chmod 664 {} \;    
find /var/www/html -type d -exec chmod 775 {} \;
chgrp -R apache storage bootstrap/cache
chmod -R ug+rwx storage bootstrap/cache

restorecon -R /var/www/html
chcon -Rv -t httpd_sys_rw_content_t bootstrap/cache
chcon -Rv -t httpd_sys_rw_content_t storage
php artisan up

This has happened twice now.

Once on dev, another time on test.

Completely re-installing from source does nothing as well.

I'm moving into production in 2 weeks, and I'm concerned about running updates in the future and not having the changes promulgate prior to the end of the maintenance window.

So I've tried it all:

php artisan view:clear
php artisan cache:clear
php artisan clear-compiled
php artisan config:clear

I've updated opcache to these settings as in this trouble ticket https://github.com/laradock/laradock/issues/355

extension=opcache.so
opcache.enable="1"
opcache.memory_consumption="256"
opcache.use_cwd="0"
opcache.fast_shutdown="1"
opcache.max_file_size="0"
opcache.validate_timestamps="1" // Modify 0 to 1
opcache.revalidate_freq="0" // Add this line

Subsequently I've done systemctl restart httpd and rebooted the server...

Changes are not reflecting.

And check this part out. I've even rebuilt the project by doing rm -rf against the project directory, reloading from git, composer install and still nada. Absolutamente nada.

I'm running CentOS and Apache. And I just don't know where else to look. Any ideas?

How to run Laravel project on normal Apache?

I have Laravel project and can run it with

php artisan serve

I am executing this command inside D:\Users\Dims\Design\MyApplication directory. After that I can see site on http://localhost:8000 and can navigate it, although slow.

Now I am configuring the same place to serve by apache:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "D:\Users\Dims\Design\MyApplication\public"
    ServerName myapplication.app
    ErrorLog "logs/myapplication-error.log"
    CustomLog "logs/myapplication-access.log" common
    <Directory />
        AllowOverride none
        Require all granted
        DirectoryIndex index.php
    </Directory>
</VirtualHost>

Not, that I pointed application not to the root of the project, but to the public directory. This makes me able to open home page of the site, but clicking any links causes error 404.

If I serve

DocumentRoot "D:\Users\Dims\Design\MyApplication"

with Apache, I am unable to see home page at all, saying 403 forbidden. This probably because this directory has no index.php.

So, is it possible to serve Laravel project with Apache?

Laravel – How to remove index.php from Laravel in windows xampp

Problem:

my routes not working except the root home page, I'm searching for two days to find a solution to this problem and what I found that I should change .htaccess file but solutions didn't fix any for my case, at first the url localhost/quotes/public was working well with me, but at some point I'm not sure what is it this issue showed up

what I tried:

  • create another route and I made sure that no routes are working only home route, still not working except home
  • tried to change OverrideMode on my XAMP from None to All, didn't fix any
  • tried to type manually localhost/quotes/public/index.php BOOM everything works ..

my htaccess file:

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

        RewriteEngine On

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

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

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

working on:

  • Windows 10
  • XAMP
  • Laravel 5.2.35

Failed to open Stream, no such file or directory

I recently started using the Laravel framework and i set up a little workspace for me to work in. I setup a Xubuntu client at home that runs a Apache server from which i program and host my Laravel instance from. Now recently I've run into a little bit of a problem. I was following a tutorial series and everything went fine, the next day however i run into this error http://puu.sh/nh5vQ/8ae11c52ab.png Both from opening the /var/www/html/test/public directory in apache2 from my webbrowser or from running php artisan and actually hosting the laravel instance.

So the first thing that came to mind was permissions, but the permissions for the public folder are fine, It should be able to read or execute as any program. http://puu.sh/nh5Ho/06e061a056.png

Mostly other posts can reference to a bit of code where they specified the wrong filepath. What i find odd is that when i open my hosted instance of apache server in my webbrowser, where you can technically browse all the files in the hosted directory it is there in the list, but when i click it it pops up with that same error.

I checked if all the files that the server is trying to acces exist, and they do exist and i made no typo's.

I'm going to continue on looking and i shall post the solution as soon as i find one, though I'm hoping you guys have an idea since I've been looking for about 2 days to find a solution.

Thanks for your time

Laravel Access forbidden on localhost xampp

I just got stuck in the very begining. I have installed laravel and when i run php artisan serv command then this(Laravel development server started on http://localhost:8000/) line appears but when i access it through browser(http://localhost:8000/) then the following error gets displayed.

Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster. Error 403 localhost Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.2

Please help me out. Any help would be greatly appreciated. I am beginner in laravel.

Response-Headers of PDF-URL is different depending on localhost

I encountered an issue regarding response headers of a request to a PDF file. I have a Laravel project and within my public folder is a PDF file.

If I start the localhost via php artisan serve and then call the PDF File with localhost:8000/thefile.pdf it is downloaded (i guess because of the Content-Type "application/octet-stream"). But if I start the localhost with xampp and call the PDF File with localhost/projectfolder/public/thefile.pdf it is shown in the browser (i guess because of the Content-Type "application/pdf").

My problem with that is not knowing the "why". The "type" of the localhost seems to handle the response-headers of PDF files. What is causing this behaviour? Is there an easy way to get the same behaviour with the localhost of "artisan serve" as with the localhost of xampp?

Here are the different response headers. They might be of interest:

Response with localhost:8000 (made with php artisan serve)

HTTP/1.1 200 OK
Host: localhost:8000
Connection: close
Content-Type: application/octet-stream
Content-Length: 212965

Response with localhost (made with xampp) (it is in the console 3 times)

1.

HTTP/1.1 200 OK
Date: Sun, 07 Dec 2014 21:36:01 GMT
Server: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
Last-Modified: Sun, 07 Dec 2014 21:11:05 GMT
ETag: "33fe5-509a6bf85e9af"
Accept-Ranges: bytes
Content-Length: 212965
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: application/pdf

2.

HTTP/1.1 206 Partial Content
Date: Sun, 07 Dec 2014 21:36:01 GMT
Server: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
Last-Modified: Sun, 07 Dec 2014 21:11:05 GMT
ETag: "33fe5-509a6bf85e9af"
Accept-Ranges: bytes
Content-Length: 32768
Content-Range: bytes 0-32767/212965
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Content-Type: application/pdf

3.

HTTP/1.1 206 Partial Content
Date: Sun, 07 Dec 2014 21:36:02 GMT
Server: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
Last-Modified: Sun, 07 Dec 2014 21:11:05 GMT
ETag: "33fe5-509a6bf85e9af"
Accept-Ranges: bytes
Content-Length: 180197
Content-Range: bytes 32768-212964/212965
Keep-Alive: timeout=5, max=97
Connection: Keep-Alive
Content-Type: application/pdf