I want to turn up an AWS EC2 server so I can make an AMI from it and use it in an auto-scaling load balanced group. I am failing left and right. I'm not espceially Linux-aware and I am out of my element.
My end result goal is an Ubuntu 18.04/PHP 7.4/Phalcon 4 server. I think i need to install the Phalcon devtools, too, in order to have it set up the applpication folder and subfolders automatically for me? I may need this explained like I'm a brand new student.
What I’ve done so far:
- T2.micro instance size
- Launch EC2 using Free Tier Ubuntu 18.04 (ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200611 (ami-0ac80df6eff0e70b5))
- Setup elastic IP and assign to staging instance
- Install Apache
- Putty to EC2 instance
- sudo apt-get update
- sudo apt-get install apache2
- Config UFW firewall
- sudo ufw app list
- sudo ufw allow 'Apache'
- Install PHP 7.4
- sudo apt upgrade
- upgrades all current packages (there were a bunch)
- Kept local menu.lst etc., when asked
- sudo apt install software-properties-common
- sudo add-apt-repository ppa:ondrej/php
- sudo apt update
- sudo apt upgrade (again)
- sudo apt install php7.4
- php -v (to confirm php installed)
- default apache webpage loads at this point along with phpinfo() that I added
There is an image made at this point, in case we need to build from here
- install PSR
- git clone https://github.com/jbboehr/php-psr.git
- apt install php7.4-dev (warning said apt install php7.2-dev, was this my prob before?)
- cd php-psr
- phpize
- ./configure
- make
- make test
- sudo make install
- had to manually add to the /etc/php/7.4/cli/php.ini (do we need to do the apache2 one too?)
- extension=psr.so
php -v returns ok now and php -m shows Phalcon as a module
I tried to move on to composer, in order to load the devtools, but I got this error:
"PHP Warning: PHP Startup: Unable to load dynamic library 'phalcon.so' (tried: /usr/lib/php/20190902/phalcon.so (/usr/lib/php/20190902/phalcon.so: undefined symbol: php_pdo_get_dbh_ce), /usr/lib/php/20190902/phalcon.so.so (/usr/lib/php/20190902/phalcon.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
I have seen errors like this a few times, like before I got PSR installed, which I'm still not sure I did correctly.