Question: I have two big numpy arrays, I need to divide them.

Since I am working on Python 32-bits, and the arrays are too big, to avoid `FloatingPointError`, I am doing, for example:

```
x = numpy.array([...],dtype=object)
y = numpy.array([...].dtype=object)

```

The problem is that, inside the array `y`, some elements can be 0.0

So, my question, how to handle the calculation `x/y` and avoid `ZeroDivisionError`.

For exmaple, I would like to force `nan` if the element in `y` is 0. So that, for that particular element inside the array, the calculation `x/y=nan`

Answer: 
I have installed laravel on EC2 instance and have spent 3 days to fix the permission error and at last fixed it.
So I want to share this experience with other one.

1. user problem
When I logged in ec2 instance, my username is ec2-user and usergroup is ec2-user.
And the website works under of httpd user: apache: apache
so we should set the permission for apache.
2. folder and file permission
A. folder structure
first, you should make sure that you have such folder structure like this under storage

storage

	* framework
		+ cache
		+ sessions
		+ views
	* logs
	The folder structure can be different according to the laravel version you use.
	my laravel version is 5.2 and you could find the appropriate structure according to your version.

B. permission
 At first, I see the instructions to set 777 under storage to remove file\_put\_contents: failed to open stream error.
 So i setup permission 777 to storage
 chmod -R 777 storage
 But the error was not fixed.
 here, you should consider one: who writes files to storage/ sessions and views.
 That is not ec2-user, but apache.
 Yes, right.
 "apache" user writes file (session file, compiled view file) to the session and view folder.
 So you should give apache to write permission to these folder.
 By default: SELinux say the /var/www folder should be read-only by the apache deamon.

So for this, we can set the selinux as 0:
 setenforce 0

This can solve problem temporally, but this makes the mysql not working.
 so this is not so good solution.

You can set a read-write context to the storage folder with: (remember to setenforce 1 to test it out)

```
chcon -Rt httpd_sys_content_rw_t storage/

```

Then your problem will be fixed.

3. and don't forget this
composer update
php artisan cache:clear

These commands will be useful after or before.

I hope you save your time.
Good luck. Hacken
I had the following configuration:

* NGINX (running user: `nginx`)
* PHP-FPM

And applied permissions correctly as @bgies suggested in the accepted answer. The problem in my case was the php-fpm's configured running user and group which was originally `apache`.

If you're using NGINX with php-fpm, you should open php-fpm's config file:

```
nano /etc/php-fpm.d/www.config

```

And replace `user` and `group` options' value with one NGINX is configured to work with; in my case, both were `nginx`:

`...
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
...`

Save it and restart nginx and php-fpm services.