I'm building an EC2 LAMP server for the first time, and so far so good.
Except I can't seem to get the
require 'vendor/autoload.php';
working right
I get this error message whenever I write that line above
Warning: require(/home/ec2-user/vendor/autoload.php): failed to open stream: Permission denied in /var/www/html/tables.php on line 6 Fatal error: require(): Failed opening required '/home/ec2-user/vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/tables.php on line 6
I know I have those files. My path to the file is:
/home/ec2-user/vendor/composer/autoload.php
The files that represent my web page are in
/var/www/html/
I can verify both using Filezilla.
Do I need to configure permissions, or move the whole vendor folder to a place where it can be accessed? Did I make an error with the path?
Thanks in advance.
ps aux | grep apache
gives me this: I think this means that its running under ec2-user?
How do I switch it, then?
apache 1511 0.0 1.5 407000 9376 ? S 15:30 0:00 /usr/sbin/httpd
apache 1512 0.0 1.3 407376 8380 ? S 15:30 0:00 /usr/sbin/httpd
apache 1513 0.0 1.5 406996 9368 ? S 15:30 0:00 /usr/sbin/httpd
apache 1514 0.0 1.3 406880 8388 ? S 15:30 0:00 /usr/sbin/httpd
apache 1515 0.0 1.5 406880 9368 ? S 15:30 0:00 /usr/sbin/httpd
apache 1516 0.0 1.3 406880 8320 ? S 15:30 0:00 /usr/sbin/httpd
apache 1517 0.0 1.5 406880 9356 ? S 15:30 0:00 /usr/sbin/httpd
apache 1518 0.0 1.3 406880 8380 ? S 15:30 0:00 /usr/sbin/httpd
ec2-user 2191 0.0 0.1 103416 828 pts/0 S+ 17:45 0:00 grep apache
require 'vendor/composer/autoload.php';
?