Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in exception handler: Permission Monolog/Handler/StreamHandler.php #655

Closed
sfxworks opened this issue Mar 10, 2018 · 28 comments
Closed

Comments

@sfxworks
Copy link

sfxworks commented Mar 10, 2018

The stream or file "/var/www/html/TechnicSolder/app/storage/logs/solderlog-2018-03-10.txt" could not be opened: failed to open stream: Permission denied in /var/www/html/TechnicSolder/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107

First setup. Followed the guide. Perms are recusive....


[quantomworks@solder-io TechnicSolder]$ cat  /etc/httpd/sites-availible/solderio.thebobsgamingnetwork.com.conf
<VirtualHost *:80>

        # Host that will serve this project.
        ServerName solder.thebobsgamingnetwork.net

        ServerAdmin sfxworks@gmail.com

        # The location of public directory.
        DocumentRoot /var/www/html/TechnicSolder/public/

        # Important options for solder public directory.
        <Directory /var/www/html/TechnicSolder/public>
              Options FollowSymLinks
              AllowOverride All

              # requires mod_version
              <IfVersion >= 2.4>
                    Require all granted
              </IfVersion>
              <IfVersion < 2.4>
                    Order allow,deny
                    Allow from all
              </IfVersion>
        </Directory>


</VirtualHost>


[quantomworks@solder-io TechnicSolder]$ cat  /etc/httpd/conf/httpd.conf  | grep apache
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
User apache
Group apache
    # http://httpd.apache.org/docs/2.4/mod/core.html#options

[quantomworks@solder-io TechnicSolder]$ ls -lah
total 208K
drwxr-xr-x.  7 apache apache 4.0K Mar 10 03:24 .
drwxr-xr-x.  3 apache apache   67 Mar 10 06:32 ..
drwxr-xr-x. 14 apache apache  228 Mar 10 03:58 app
-rwxr-xr-x.  1 apache apache 2.4K Mar 10 03:00 artisan
drwxr-xr-x.  2 apache apache   60 Mar 10 03:00 bootstrap
-rwxr-xr-x.  1 apache apache 2.1K Mar 10 03:00 composer.json
-rwxr-xr-x.  1 apache apache 156K Mar 10 03:24 composer.lock
-rwxr-xr-x.  1 apache apache 1.5K Mar 10 03:00 CONTRIBUTING.md
drwxr-xr-x.  8 apache apache  163 Mar 10 03:00 .git
-rwxr-xr-x.  1 apache apache  216 Mar 10 03:00 .gitattributes
-rwxr-xr-x.  1 apache apache  185 Mar 10 03:00 .gitignore
-rwxr-xr-x.  1 apache apache 2.2K Mar 10 03:00 LICENSE
-rwxr-xr-x.  1 apache apache  997 Mar 10 03:00 phpunit.php
-rwxr-xr-x.  1 apache apache  567 Mar 10 03:00 phpunit.xml
drwxr-xr-x.  9 apache apache  175 Mar 10 03:00 public
-rwxr-xr-x.  1 apache apache 2.6K Mar 10 03:00 README.md
-rwxr-xr-x.  1 apache apache  519 Mar 10 03:00 server.php
-rwxr-xr-x.  1 apache apache 1.6K Mar 10 03:00 .travis.yml
drwxr-xr-x. 32 apache apache 4.0K Mar 10 03:24 vendor


[quantomworks@solder-io TechnicSolder]$ sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-03-10 07:53:38 UTC; 3min 18s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 25760 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
 Main PID: 25764 (httpd)
   Status: "Total requests: 1; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─25764 /usr/sbin/httpd -DFOREGROUND
           ├─25767 /usr/sbin/httpd -DFOREGROUND
           ├─25768 /usr/sbin/httpd -DFOREGROUND
           ├─25769 /usr/sbin/httpd -DFOREGROUND
           ├─25770 /usr/sbin/httpd -DFOREGROUND
           ├─25771 /usr/sbin/httpd -DFOREGROUND
           └─25773 /usr/sbin/httpd -DFOREGROUND

Mar 10 07:53:38 solder-io systemd[1]: Starting The Apache HTTP Server...
Mar 10 07:53:38 solder-io systemd[1]: Started The Apache HTTP Server.


[quantomworks@solder-io TechnicSolder]$ php -version
PHP 5.6.33 (cli) (built: Jan 14 2018 08:07:11)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies


[quantomworks@solder-io TechnicSolder]$ php -m
[PHP Modules]
apc
apcu
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
json
libxml
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache


[quantomworks@solder-io /]$ rpm --query centos-release
centos-release-7-4.1708.el7.centos.x86_64

@Indemnity83
Copy link
Contributor

You need to make the app/storage folder and the things under it writable for the web server.

@sfxworks
Copy link
Author

Do the services required to write to app/storage not operate under the Apache user? Perms were recursive so Apache has read write and execute in that directory. I even tried 777 to be sure.

@Indemnity83
Copy link
Contributor

It would be if you were running php with mod_php; but I don't see that mod so I assume its probably php-fpm. check /etc/php-fpm.d/www.conf file for the user and group that php-fpm is running under.

@sfxworks
Copy link
Author

sfxworks commented Mar 10, 2018

It's Apache.

[quantomworks@solder-io ~]$ cat /etc/php-fpm.d/www.conf | grep apache
; RPM: apache Choosed to be able to access some dir as httpd
user = apache
group = apache

-rwxrwxrwx. 1 apache apache 5.1K Mar 10 03:24 StreamHandler.php
-rwxrwxrwx. 1 apache apache 3.4K Mar 10 04:04 solderlog-2018-03-09.txt

@Indemnity83
Copy link
Contributor

Indemnity83 commented Mar 10, 2018

Wait, you changed the permissions on the StreamHandler? Also today is the 10th so that log file isn't the one its going to try to write to ...

Change the permissions of the whole storage folder and subfolders to 777 and see if that resolves the problem. If it does, pull it back to 775. if pulling it back to 775 breaks it again then somewhere you're configs are not acting as the user you expect.

@sfxworks
Copy link
Author

sfxworks commented Mar 10, 2018

Setting it all to 777 again...

[quantomworks@solder-io www]$ sudo chmod -R 777 html/
[quantomworks@solder-io www]$ ls -lah
total 0
drwxr-xr-x.  4 apache apache  33 Mar 10 02:18 .
drwxr-xr-x. 19 root   root   265 Mar 10 02:18 ..
drwxr-xr-x.  2 apache apache   6 Oct 19 20:39 cgi-bin
drwxrwxrwx.  3 apache apache  67 Mar 10 06:32 html

Same error.
Redirects to /login
Error in exception handler: The stream or file "/var/www/html/TechnicSolder/app/storage/logs/solderlog-2018-03-10.txt" could not be opened: failed to open stream: Permission denied in /var/www/html/TechnicSolder/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107

[quantomworks@solder-io www]$ cd html
[quantomworks@solder-io html]$ ls -lah
total 1.8M
drwxrwxrwx. 3 apache apache   67 Mar 10 06:32 .
drwxr-xr-x. 4 apache apache   33 Mar 10 02:18 ..
-rwxrwxrwx. 1 apache apache 1.8M Mar 10 02:59 composer.phar
-rwxrwxrwx. 1 apache apache   21 Mar 10 02:46 phpinfo.php
drwxrwxrwx. 7 apache apache 4.0K Mar 10 03:24 TechnicSolder
[quantomworks@solder-io html]$ cd Tech
-bash: cd: Tech: No such file or directory
[quantomworks@solder-io html]$ cd TechnicSolder/
[quantomworks@solder-io TechnicSolder]$ ls -lah
total 208K
drwxrwxrwx.  7 apache apache 4.0K Mar 10 03:24 .
drwxrwxrwx.  3 apache apache   67 Mar 10 06:32 ..
drwxrwxrwx. 14 apache apache  228 Mar 10 03:58 app
-rwxrwxrwx.  1 apache apache 2.4K Mar 10 03:00 artisan
drwxrwxrwx.  2 apache apache   60 Mar 10 03:00 bootstrap
-rwxrwxrwx.  1 apache apache 2.1K Mar 10 03:00 composer.json
-rwxrwxrwx.  1 apache apache 156K Mar 10 03:24 composer.lock
-rwxrwxrwx.  1 apache apache 1.5K Mar 10 03:00 CONTRIBUTING.md
drwxrwxrwx.  8 apache apache  163 Mar 10 03:00 .git
-rwxrwxrwx.  1 apache apache  216 Mar 10 03:00 .gitattributes
-rwxrwxrwx.  1 apache apache  185 Mar 10 03:00 .gitignore
-rwxrwxrwx.  1 apache apache 2.2K Mar 10 03:00 LICENSE
-rwxrwxrwx.  1 apache apache  997 Mar 10 03:00 phpunit.php
-rwxrwxrwx.  1 apache apache  567 Mar 10 03:00 phpunit.xml
drwxrwxrwx.  9 apache apache  175 Mar 10 03:00 public
-rwxrwxrwx.  1 apache apache 2.6K Mar 10 03:00 README.md
-rwxrwxrwx.  1 apache apache  519 Mar 10 03:00 server.php
-rwxrwxrwx.  1 apache apache 1.6K Mar 10 03:00 .travis.yml
drwxrwxrwx. 32 apache apache 4.0K Mar 10 03:24 vendor
[quantomworks@solder-io TechnicSolder]$ cd app
[quantomworks@solder-io app]$ ls -lah
total 20K
drwxrwxrwx. 14 apache apache  228 Mar 10 03:58 .
drwxrwxrwx.  7 apache apache 4.0K Mar 10 03:24 ..
drwxrwxrwx.  2 apache apache   22 Mar 10 03:00 commands
drwxrwxrwx.  4 apache apache  269 Mar 10 03:00 config
drwxrwxrwx.  2 apache apache 4.0K Mar 10 03:00 controllers
drwxrwxrwx.  4 apache apache   37 Mar 10 03:00 database
drwxrwxrwx.  2 apache apache   31 Mar 10 03:00 database-sample
-rwxrwxrwx.  1 apache apache 5.2K Mar 10 03:00 filters.php
drwxrwxrwx.  3 apache apache   16 Mar 10 03:00 lang
drwxrwxrwx.  3 apache apache   92 Mar 10 03:00 libraries
drwxrwxrwx.  2 apache apache  154 Mar 10 03:00 models
-rwxrwxrwx.  1 apache apache  836 Mar 10 03:00 routes.php
drwxrwxrwx.  2 apache apache   60 Mar 10 03:00 start
drwxrwxrwx. 10 apache apache  147 Mar 10 03:00 storage
drwxrwxrwx.  2 apache apache  213 Mar 10 03:00 tests
drwxrwxrwx. 11 apache apache  129 Mar 10 03:00 views
[quantomworks@solder-io app]$ cd storage
[quantomworks@solder-io storage]$ cd logs
[quantomworks@solder-io logs]$ ls -lah
total 8.0K
drwxrwxrwx.  2 apache apache   56 Mar 10 04:04 .
drwxrwxrwx. 10 apache apache  147 Mar 10 03:00 ..
-rwxrwxrwx.  1 apache apache   13 Mar 10 03:00 .gitignore
-rwxrwxrwx.  1 apache apache 3.4K Mar 10 04:04 solderlog-2018-03-09.txt

@skwerlman
Copy link
Contributor

what do you see when running ps -aux | grep php?

@Indemnity83
Copy link
Contributor

Some googling many folks point to clearing the cache after/before changing the permissions. I'm not sure I follow this but its worth trying:

php artisan cache:clear 
chmod 775 app/storage
composer dump-autoload

@sfxworks
Copy link
Author

sfxworks commented Mar 10, 2018

@skwerlman
[quantomworks@solder-io ~]$ ps -aux | grep php
quantom+ 1127 0.0 0.0 112660 972 pts/1 S+ 23:13 0:00 grep --color=auto php
?

@Indemnity83
Running:

[quantomworks@solder-io /]$ cd var
[quantomworks@solder-io var]$ cd www
[quantomworks@solder-io www]$ cd html
[quantomworks@solder-io html]$ cd TechnicSolder
[quantomworks@solder-io TechnicSolder]$ php artisan cache:clear
Application cache cleared!
[quantomworks@solder-io TechnicSolder]$ sudo chmod 775 app/storage
[quantomworks@solder-io TechnicSolder]$ ../composer.phar dump-autoload
Generating autoload files
[quantomworks@solder-io TechnicSolder]$

Yields:
image

at http://solder.thebobsgamingnetwork.net/

@Indemnity83
Copy link
Contributor

There absolutely must be something wrong with your permissions; Can you make a file in the public folder, something like check.php with the following; this should dump out the user that PHP is running as;

<?php
$processUser = posix_getpwuid(posix_geteuid());
print $processUser['name'];
?>

@sfxworks
Copy link
Author

sfxworks commented Mar 10, 2018

Apache :/
image

@Indemnity83
Copy link
Contributor

I'm at a loss...

@sfxworks
Copy link
Author

sfxworks commented Mar 10, 2018

For the record, this is the repo I got php 5.6 from for Centos 7 if it matters. https://webtatic.com/packages/php56/

I couldn't follow the guide exactly due to it installing php 5.4 and other extensions under that version by default. That, running composer.phar outside of TechnicSolder/ and setting the perms up based on httpd's user were the only commands I did differently vs the guide's commands. Could it be an issue with the repo?

What distro are you all using in the guide? I am running a VM on Google Could so I could just try following it do the dot again.

It's certainly apache and httpd that is running. Spamming refresh on the page makes this service spike. Don't know what else it could be if it's not something being handled incorrectly here.

25767 apache 20 0 670704 21800 11916 S 0.7 0.6 0:00.17 httpd

@sfxworks
Copy link
Author

sfxworks commented Mar 11, 2018

For anyone here referencing URLs, I am shutting down the VM. So, they will not work at this time.

@spannerman79
Copy link

I am shutting down the VM

IF the VM is just handling solder you should of followed the solder docs when first setting up - in particular https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7 before starting the actual process of obtaining the needed packages via yum

Mid way through that digital ocean guide before installing php I'd first follow https://rpms.remirepo.net/wizard/ to ensure you have the correct repo added for php 5.6+

@sfxworks
Copy link
Author

sfxworks commented Mar 11, 2018

@spannerman79 Cool so now I get a bad gateway.
image

[quantomworks@solder-io2 nginx]$ cat nginx.conf
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

server {
    listen 80; #IPv4
    listen [::]:80; #IPv6

    # Host that will serve this project.
    server_name    solder.thebobsgamingnetwork.net;

    # The location of our projects public directory.
    root            /usr/share/nginx/html/TechnicSolder/public;
    index index.php;

    location / {
        # URLs to attempt, including pretty ones
        try_files   $uri $uri/ /index.php?$query_string;
    }

    # PHP FPM configuration.
    location ~* \.php$ {
            fastcgi_pass                    unix:/var/run/php-fpm.sock;
            fastcgi_index                   index.php;
            fastcgi_split_path_info         ^(.+\.php)(.*)$;
            include                         fastcgi_params;
            fastcgi_param PATH_INFO         $fastcgi_path_info;
            fastcgi_param SCRIPT_FILENAME   $document_root$fastcgi_script_name;
    }

    # We don't need .ht files with nginx.
    location ~ /\.ht {
            deny all;
    }

    # Hide dot files/folders
    location ~ .*/\. {
            return 403;
    }

    # Set header expirations on per-project basis
    location ~* \.(?:ico|css|js|jpe?g|JPG|png|svg|woff)$ {
            expires 365d;

    }
}
}

#  Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2 default_server;
#        listen       [::]:443 ssl http2 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }



[quantomworks@solder-io2 nginx]$ cat nginx.conf | grep user
user nginx;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
                      
[quantomworks@solder-io2 usr]$ cd /usr/share/nginx/html/TechnicSolder/public
[quantomworks@solder-io2 public]$ ls -lah
total 20K
drwxrwxrwx. 9 nginx nginx  175 Mar 11 02:33 .
drwxrwxrwx. 7 nginx nginx 4.0K Mar 11 03:47 ..
drwxrwxrwx. 2 nginx nginx  199 Mar 11 02:33 css
-rwxrwxrwx. 1 nginx nginx 1.2K Mar 11 02:33 favicon.ico
drwxrwxrwx. 6 nginx nginx   54 Mar 11 02:33 font-awesome
drwxrwxrwx. 2 nginx nginx  167 Mar 11 02:33 fonts
-rwxrwxrwx. 1 nginx nginx  356 Mar 11 02:33 .htaccess
drwxrwxrwx. 2 nginx nginx  106 Mar 11 02:33 img
-rwxrwxrwx. 1 nginx nginx 1.6K Mar 11 02:33 index.php
drwxrwxrwx. 3 nginx nginx  260 Mar 11 02:33 js
drwxrwxrwx. 2 nginx nginx   22 Mar 11 02:33 packages
drwxrwxrwx. 3 nginx nginx   21 Mar 11 02:33 resources
-rwxrwxrwx. 1 nginx nginx   24 Mar 11 02:33 robots.txt
[quantomworks@solder-io2 public]$ sudo systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2018-03-11 03:56:32 UTC; 5min ago
  Process: 23150 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 23148 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 23147 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 23153 (nginx)
   CGroup: /system.slice/nginx.service
           ├─23153 nginx: master process /usr/sbin/nginx
           └─23154 nginx: worker process

Mar 11 03:56:32 solder-io2 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Mar 11 03:56:32 solder-io2 nginx[23148]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Mar 11 03:56:32 solder-io2 nginx[23148]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Mar 11 03:56:32 solder-io2 systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument
Mar 11 03:56:32 solder-io2 systemd[1]: Started The nginx HTTP and reverse proxy server.

[quantomworks@solder-io2 public]$ php -version
PHP 5.6.34 (cli) (built: Feb 28 2018 10:16:58)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
[quantomworks@solder-io2 public]$ php -m
[PHP Modules]
apc
apcu
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
SQLite
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]

[quantomworks@solder-io2 public]$ rpm --query centos-release
centos-release-7-4.1708.el7.centos.x86_64

Solder Config

[quantomworks@solder-io2 config]$ cat app.php
<?php

return array(

        /*
        |--------------------------------------------------------------------------
        | Application Debug Mode
        |--------------------------------------------------------------------------
        |
        | When your application is in debug mode, detailed error messages with
        | stack traces will be shown on every error that occurs within your
        | application. If disabled, a simple generic error page is shown.
        |
        */

        'debug' => true,

        /*
        |--------------------------------------------------------------------------
        | Application URL
        |--------------------------------------------------------------------------
        |
        | This URL is used by the console to properly generate URLs when using
        | the Artisan command line tool. You should set this to the root of
        | your application so that it is used when running Artisan tasks.
        |
        */

        'url' => 'http://solder.thebobsgamingnetwork.net:8000',

        /*
        |--------------------------------------------------------------------------
        | Application Timezone
        |--------------------------------------------------------------------------
        |
        | Here you may specify the default timezone for your application, which
        | will be used by the PHP date and date-time functions. We have gone
        | ahead and set this to a sensible default for you out of the box.
        |
        */

        'timezone' => 'EST',

        /*
        |--------------------------------------------------------------------------
        | Application Locale Configuration
        |--------------------------------------------------------------------------
        |
        | The application locale determines the default locale that will be used
        | by the translation service provider. You are free to set this value
        | to any of the locales which will be supported by the application.
        |
        */

        'locale' => 'en',

        /*
        |--------------------------------------------------------------------------
        | Application Fallback Locale
        |--------------------------------------------------------------------------
        |
        | The fallback locale determines the locale to use when the current one
        | is not available. You may change the value to correspond to any of
        | the language folders that are provided through your application.
        |
        */

        'fallback_locale' => 'en',

        /*
        |--------------------------------------------------------------------------
        | Encryption Key
        |--------------------------------------------------------------------------
        |
        | This key is used by the Illuminate encrypter service and should be set
        | to a random, 32 character string, otherwise these encrypted strings
        | will not be safe. Please do this before deploying an application!
        |
        */

        'key' => 'YourSecretKey!!!',

        'cipher' => MCRYPT_RIJNDAEL_128,

        /*
        |--------------------------------------------------------------------------
        | Autoloaded Service Providers
        |--------------------------------------------------------------------------
        |
        | The service providers listed here will be automatically loaded on the
        | request to your application. Feel free to add your own services to
        | this array to grant expanded functionality to your applications.
        |
        */

        'providers' => array(

                'Illuminate\Foundation\Providers\ArtisanServiceProvider',
                'Illuminate\Auth\AuthServiceProvider',
                'Illuminate\Cache\CacheServiceProvider',
                'Illuminate\Session\CommandsServiceProvider',
                'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
                'Illuminate\Routing\ControllerServiceProvider',
                'Illuminate\Cookie\CookieServiceProvider',
                'Illuminate\Database\DatabaseServiceProvider',
                'Illuminate\Encryption\EncryptionServiceProvider',
                'Illuminate\Filesystem\FilesystemServiceProvider',
                'Illuminate\Hashing\HashServiceProvider',
                'Illuminate\Html\HtmlServiceProvider',
                'Illuminate\Log\LogServiceProvider',
                'Illuminate\Mail\MailServiceProvider',
                'Illuminate\Database\MigrationServiceProvider',
                'Illuminate\Pagination\PaginationServiceProvider',
                'Illuminate\Queue\QueueServiceProvider',
                'Illuminate\Redis\RedisServiceProvider',
                'Illuminate\Remote\RemoteServiceProvider',
                'Illuminate\Auth\Reminders\ReminderServiceProvider',
                'Illuminate\Database\SeedServiceProvider',
                'Illuminate\Session\SessionServiceProvider',
                'Illuminate\Translation\TranslationServiceProvider',
                'Illuminate\Validation\ValidationServiceProvider',
                'Illuminate\View\ViewServiceProvider',
                'Illuminate\Workbench\WorkbenchServiceProvider',
                'Intervention\Image\ImageServiceProvider',

        ),

        /*
        |--------------------------------------------------------------------------
        | Service Provider Manifest
        |--------------------------------------------------------------------------
        |
        | The service provider manifest is used by Laravel to lazy load service
        | providers which are not needed for each request, as well to keep a
        | list of all of the services. Here, you may set its storage spot.
        |
        */

        'manifest' => storage_path().'/meta',

        /*
        |--------------------------------------------------------------------------
        | Class Aliases
        |--------------------------------------------------------------------------
        |
        | This array of class aliases will be registered when this application
        | is started. However, feel free to register as many as you wish as
        | the aliases are "lazy" loaded so they don't hinder performance.
        |
        */

        'aliases' => array(

                'App'               => 'Illuminate\Support\Facades\App',
                'Artisan'           => 'Illuminate\Support\Facades\Artisan',
                'Auth'              => 'Illuminate\Support\Facades\Auth',
                'Blade'             => 'Illuminate\Support\Facades\Blade',
                'Cache'             => 'Illuminate\Support\Facades\Cache',
                'ClassLoader'       => 'Illuminate\Support\ClassLoader',
                'Config'            => 'Illuminate\Support\Facades\Config',
                'Controller'        => 'Illuminate\Routing\Controller',
                'Cookie'            => 'Illuminate\Support\Facades\Cookie',
                'Crypt'             => 'Illuminate\Support\Facades\Crypt',
                'DB'                => 'Illuminate\Support\Facades\DB',
                'Eloquent'          => 'Illuminate\Database\Eloquent\Model',
                'Event'             => 'Illuminate\Support\Facades\Event',
                'File'              => 'Illuminate\Support\Facades\File',
                'Form'              => 'Illuminate\Support\Facades\Form',
                'Hash'              => 'Illuminate\Support\Facades\Hash',
                'HTML'              => 'Illuminate\Support\Facades\HTML',
                'Image'             => 'Intervention\Image\Facades\Image',
                'Input'             => 'Illuminate\Support\Facades\Input',
                'Lang'              => 'Illuminate\Support\Facades\Lang',
                'Log'               => 'Illuminate\Support\Facades\Log',
                'Mail'              => 'Illuminate\Support\Facades\Mail',
                'Paginator'         => 'Illuminate\Support\Facades\Paginator',
                'Password'          => 'Illuminate\Support\Facades\Password',
                'Queue'             => 'Illuminate\Support\Facades\Queue',
                'Redirect'          => 'Illuminate\Support\Facades\Redirect',
                'Redis'             => 'Illuminate\Support\Facades\Redis',
                'Request'           => 'Illuminate\Support\Facades\Request',
                'Response'          => 'Illuminate\Support\Facades\Response',
                'Route'             => 'Illuminate\Support\Facades\Route',
                'Schema'            => 'Illuminate\Support\Facades\Schema',
                'Seeder'            => 'Illuminate\Database\Seeder',
                'Session'           => 'Illuminate\Support\Facades\Session',
                'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait',
                'SSH'               => 'Illuminate\Support\Facades\SSH',
                'Str'               => 'Illuminate\Support\Str',
                'URL'               => 'Illuminate\Support\Facades\URL',
                'Validator'         => 'Illuminate\Support\Facades\Validator',
                'View'              => 'Illuminate\Support\Facades\View',

        ),

);


[quantomworks@solder-io2 config]$ cat solder.php
<?php

return array(
        /**
         * Mod Respository Location
         *
         * This is the location of your mod reposistory. INCLUDE a trailing slash!
         * This can be a URL or an absolute file location.
         *
         **/
        'repo_location' => '/usr/share/nginx/html/repodata/',

        /**
         * Mirror Location
         *
         * This is where the launcher will be told to search for your files. If your
         * repo location is already a URL you can use the same location here.
         *
         **/
        'mirror_url' => 'https://storage.googleapis.com/tbgn-files/solder/',

        /**
         * MD5 Connect Timeout
         *
         * This is the amount of time Solder will wait before giving up trying to
         * connect to a URL to perform a MD5 checksum.
         *
         **/
        'md5_connect_timeout' => 5,

        /**
         * MD5 Hashing Timeout
         *
         * This is the amount of time Solder will wait before giving up trying to
         * calculate the MD5 checksum.
         *
         **/
        'md5_file_timeout' => 30,

        /**
         * Amazon S3 Integration
         *
         * If you would like to use Amazon S3 for serving your pack resources set this to
         * true and fill in your AWS information below.
         */
        'use_s3' => false,

        /**
         * Amazon AWS Access Key
         */
        'access_key' => '',

        /**
         * Amazon AWS Secret Key
         */
        'secret_key' => '',

        /**
         * Amazon S3 Bucket
         *
         * This is the bucket that will be used to store your pack resources
         */
        'bucket' => 'solder',
);

?>


[quantomworks@solder-io2 config]$ cat database.php
<?php

return array(

        /*
        |--------------------------------------------------------------------------
        | PDO Fetch Style
        |--------------------------------------------------------------------------
        |
        | By default, database results will be returned as instances of the PHP
        | stdClass object; however, you may desire to retrieve records in an
        | array format for simplicity. Here you can tweak the fetch style.
        |
        */

        'fetch' => PDO::FETCH_CLASS,

        /*
        |--------------------------------------------------------------------------
        | Default Database Connection Name
        |--------------------------------------------------------------------------
        |
        | Here you may specify which of the database connections below you wish
        | to use as your default connection for all database work. Of course
        | you may use many connections at once using the Database library.
        |
        */

        'default' => 'mysql',

        /*
        |--------------------------------------------------------------------------
        | Database Connections
        |--------------------------------------------------------------------------
        |
        | Here are each of the database connections setup for your application.
        | Of course, examples of configuring each database platform that is
        | supported by Laravel is shown below to make development simple.
        |
        |
        | All database work in Laravel is done through the PHP PDO facilities
        | so make sure you have the driver for your particular database of
        | choice installed on your machine before you begin development.
        |
        */

        'connections' => array(

                'sqlite' => array(
                        'driver'   => 'sqlite',
                        'database' => __DIR__.'/../database/production.sqlite',
                        'prefix'   => '',
                ),

                'mysql' => array(
                        'driver'    => 'mysql',
                        'host'      => '35.199.63.93',
                        'database'  => 'solder',
                        'username'  => 'solder',
                        'password'  => 'itsIPRestrictedAnyway',
                        'charset'   => 'utf8',
                        'collation' => 'utf8_unicode_ci',
                        'prefix'    => '',
                ),

                'pgsql' => array(
                        'driver'   => 'pgsql',
                        'host'     => 'localhost',
                        'database' => 'forge',
                        'username' => 'forge',
                        'password' => '',
                        'charset'  => 'utf8',
                        'prefix'   => '',
                        'schema'   => 'public',
                ),

                'sqlsrv' => array(
                        'driver'   => 'sqlsrv',
                        'host'     => 'localhost',
                        'database' => 'database',
                        'username' => 'root',
                        'password' => '',
                        'prefix'   => '',
                ),

        ),

        /*
        |--------------------------------------------------------------------------
        | Migration Repository Table
        |--------------------------------------------------------------------------
        |
        | This table keeps track of all the migrations that have already run for
        | your application. Using this information, we can determine which of
        | the migrations on disk haven't actually been run in the database.
        |
        */

        'migrations' => 'migrations',

        /*
        |--------------------------------------------------------------------------
        | Redis Databases
        |--------------------------------------------------------------------------
        |
        | Redis is an open source, fast, and advanced key-value store that also
        | provides a richer set of commands than a typical key-value systems
        | such as APC or Memcached. Laravel makes it easy to dig right in.
        |
        */

        'redis' => array(

                'cluster' => false,

                'default' => array(
                        'host'     => '127.0.0.1',
                        'port'     => 6379,
                        'database' => 0,
                ),

        ),

);

@sfxworks
Copy link
Author

sfxworks commented Mar 11, 2018

Sidenote, this is issue 655
(get it? chmod 655? no? ill stop...)

@sfxworks
Copy link
Author

sfxworks commented Mar 11, 2018

Ok, I am able to get a server up. I followed this guide for Debian 8 (skipping mysql since I have a cloud SQL instance) https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-debian-8. Able to login and get it going.

But now when I try to make a Modpack or edit the modpack I get the same error.

Error in exception handler: The stream or file "/var/www/html/TechnicSolder/app/storage/logs/solderlog-2018-03-11.txt" could not be opened: failed to open stream: Permission denied in /var/www/html/TechnicSolder/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107

This is, again, involving me changing the ownership of /var/www/ to nginx and me per this answer
https://askubuntu.com/a/9411

So why it is able to write to this log file on login but not on modpack creation or adjustments? Why even certain sectors in the folder?
image

This also happens when I try to add a new modpack now as opposed to after hitting "add modpack".

Also, that fodler specified in the screenshot doesn't exist.

@sfxworks
Copy link
Author

sfxworks commented Mar 13, 2018

Seriously is this not proof of a code issue? If the entire folder is chmod 777 yet I get these issues? How could it even be a perms issue in the first place is I have had 777
I have set up multiple lamp and lemp stacks yet even following everything down to a T is only yielding partial results.

@Indemnity83
Copy link
Contributor

I know this is going to sound pompous, I don't intend it to, but I don't think its proof of a code issue because there are hundreds if not thousands of deployments of solder without this issue.

I can't figure out what is different about yours, but something must be.

@sfxworks
Copy link
Author

sfxworks commented Mar 15, 2018

Reached out to Google to be safe as they provide support for handling lemp stack setups. So after a thread with them in the background (with them monitoring this one), this is what I got.

Hello Samuel,

Thank you for your response.  I appreciate you letting us know of your concern and upon further checking, the issue encountered is mostly a solder.io concern which is a third-party tool that is out of scope of Google Cloud Platform Support and whose services are not covered by the Google App Engine Service Level Agreement[1]. As such, to better assist you with your issue, you may post your concern here[2] in the solder.io support channel.

Hoping for your understanding in this matter.

Kind Regards,
Rox
Google Cloud Platform Support, Manila

So if no one here has any ideas as to why such an odd thing would happen, even after we initially confirmed 15 some odd posts ago that I was using 777 on my folder, I think I'll just use the CDN they gave me to keep distributing the .zip for now...

@BinaryAura
Copy link

Do you think this may be a SELinux issue?

@Pyker
Copy link
Member

Pyker commented Aug 10, 2019 via email

@sfxworks
Copy link
Author

In this scenario, I was not using SELinux.
Is there a docker image available? If not I would be happy to take an attempt at this again.

@neldh
Copy link

neldh commented Sep 30, 2019

Maybe this hint will solve your problem:
I had similar issue when created 2 instances of guzzle client with monolog handlers on docker for windows/laravel environment. Then, when they attempt to log to the same file (one after another), the second attempt raised with this exception. The problem was solved when I started to create only one instance.

@sfxworks
Copy link
Author

sfxworks commented Sep 30, 2019

1 year later and some experience at a hosting company, ill try to take a wack at this again as well as containerizing it. Kubernetes is a thing now so I'd be happy to make a chart for it too if it all works to simplify everyone's experience.

@Pyker
Copy link
Member

Pyker commented May 21, 2020

This is a permissions issue. The storage folder needs to be writable by the PHP daemon (which may or may not be the same user as your web server). I'm closing this now.

@Pyker Pyker closed this as completed May 21, 2020
@Josecore
Copy link

Josecore commented Dec 6, 2022

It would be if you were running php with mod_php; but I don't see that mod so I assume its probably php-fpm. check /etc/php-fpm.d/www.conf file for the user and group that php-fpm is running under.

Thank you @Indemnity83, it works for me after changing this to the same user and group as php-fpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants