I am trying to set up a LAMP stack on my Amazon Web Service AMI, which is an Ubuntu System.
I went through this tutorial: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
The only difference which I made is installing php 7.
I stuck at this Point: Start the MySQL server.
[ec2-user ~]$ sudo service mysqld start
Currently it Returns this error:
mysqld: unrecognized Service
Same for These commands:
[ec2-user ~]$ sudo service mysql start
[ec2-user ~]$ sudo service mysqlnd start
If I run php -i | grep mysqlnd I get following Output:
/etc/php-7.0.d/20-mysqlnd.ini, Client API library version => mysqlnd
5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ mysqlnd mysqlnd => enabled Version => mysqlnd 5.0.12-dev - 20150407
- $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password mysqlnd statistics => Client API version => mysqlnd 5.0.12-dev -
20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $
On Ubuntu 16.04, the command would be:
sudo service mysql start
It looks like the MySQL server might not be installed. You can install the MySQL server and client tools with:
sudo apt-get install mysql-server
You will be asked to create a password for the MySQL root user during installation.
The tutorial you link to is for Amazon Linux, which (amongst other differences) uses a different package manager than Ubuntu to install and manage software. In the tutorial, the line sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd would have installed the mysql56-server package alongside apache and php.
If you need a web server quickly without have to worry about setup you may as well launch an instance picked from the AWS Marketplace. There are perfect Amazon Machine Images (AMI) for any situation.
For instance, Bitnami offers LAMP solutions on AWS Marketplace with no extra cost besides EC2 pricing.
Related
Trying to install redis extensions for php 7.0 on my high sierra apache.
brew install php-redis - doesn't work.
brew install php#7.0-redis - doesn't work.
brew install php70-redis - doesn't work.
google google google - Homebrew is the wrong approach, use pecl, they say.
pecl search redis shows:
redis 4.0.2 (stable) 4.0.2 PHP extension for interfacing with Redis
so pecl install redis
pecl/redis is already installed and is the same as the released version 4.0.2
install failed
hmm. that's right. And I've put in the reference to the ini file:
cat /usr/local/etc/php/7.0/conf.d/ext-redis.ini
[redis]
extension="/usr/local/lib/php/pecl/20160303/redis.so"
sudo service apachectl -k restart
check phpinfo() - no mention of redis but it does state that it is loading at the ext-redis.ini file.
Definately not loading, since if I try to use it on a php page I get
Fatal error: Uncaught phpFastCache\Exceptions\phpFastCacheDriverCheckException: Redis is not installed or is misconfigured, cannot continue.
What are the steps for getting redis connected in php on macos in 2018?
I was struggling with same issue my issue is solved with bellow steps.
git clone https://www.github.com/phpredis/phpredis.git
cd phpredis
phpize && ./configure && make && sudo make install
Add extension=redis.so in your php.ini
my php.ini path is this you can find php.ini path through phpinfo();/usr/local/etc/php/7.0/php.ini
restart your php
brew services restart php#7.0
run make test.
Redis support is enable .Now you can view in phpinfo()
You may want to use "Predis" instead of "Redis" which is an applicative client designed for people that can't make use of php "Redis" extension. However your Redis service must be running and listening for internal connections.
I have a cloud hosted VPS with Centos 6.6 + Direct Admin + PHP 5.6.6 installed by my hosting provider.
I need to have the MongoDB php driver installed to connect to an external mongoDB.
I tried the following installations:
http://www.liquidweb.com/kb/how-to-install-the-mongodb-php-driver-extension-on-centos-6/
http://andres.jaimes.net/876/setup-mongo-php-module-centos-6/
install-mongodb-php-driver-in-centos-6-3 at madcoda com
Also yum --enablerepo=remi,remi-php56 php-pecl-mongo does not do the trick
I have in /usr/lib64/php/modules/ the following modules:
bz2.so, calendar.so, ctype.so, curl.so, exif.so, fileinfo.so, ftp.so, gettext.so, iconv.so, json.so, mongo.so, phar.so, sockets.so, tokenizer.so, zip.so
And in /etx/php.d/ the .ini files that are created for each module.
Installing mongo php driver on an old vps with centos 5.x was not a problem also not on Centos 6.2 with php 5.5.
In these cases the mongo.so was located in the location /usr/local/php/lib/php/extensions/no-debug-non-zts-xxxxxx/ and had to add it manually to the php.ini
The hosting provider is not supporting any else than the default installation I got.
I really appreciate any help.
Stan
I found the solution in the comment of this answer https://serverfault.com/questions/589877/pecl-command-produces-long-list-of-errors
PEAR had to be reinstalled from the remi-php56 repo because of PHP 5.6 running on the server.
After that I could use pecl install mongo and copy the mongo.so to the /usr/local/php/lib/php/extensions/no-debug-non-zts-xxxxxx/ folder.
# php -m | grep -i mongo > mongo is running
I have installed MongoDB service in my Centos 6 cloud server. Now i need to install in my server php-pecl-mongo-1.2.10-1.el6.remi.x86_64.rpm... but it gives "packages not found". Can anyone fix this problem? My php version is PHP 5.3.3.
I am using putty for configuring Centos 6 server. I have admin privilege to configure php.ini.
You could:
try RPM installing php-pecl-mongo without a specific version
point to a specific RPM url for installation, eg. using rpmfind.net => php-pecl-mongo
install using sudo pecl install mongo per the Unix installation instructions
how can i upgrade from 5.1.6 to 5.2 using plesk, i need this upgrade in order to build my app cheers?
From this post:
In order to upgrade PHP 5 on a Linux server to the latest version perform the following steps.
Applies to:
Plesk 8.x for Linux
Plesk 9.x for Linux
Download the installer script which updates Yum's repositories:
[root#server ~]# wget http://78.129.170.254/cpinstall/atomic
--2009-11-12 15:40:22-- http://78.129.170.254/cpinstall/atomic
Connecting to 78.129.170.254:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8918 (8.7K) [text/plain]
Saving to: `atomic'
100%[=====================================>] 8,918 35.7K/s in 0.2s
2009-11-12 15:40:22 (35.7 KB/s) - `atomic' saved [8918/8918]
Execute this downloaded script using the following command:
[root#server ~]# sh atomic
Atomic Archive installer, version 1.1
Configuring the [atomic] yum archive for this system
Installing the Atomic GPG key: OK
Downloading atomic-release-1.0-10.el5.art.noarch.rpm: OK
Would you like to add the Plesk yum repository to the system?
Enable Plesk repository? (y/n) [Default: n]: y
Plesk 8.6 and 9.2 repositories are available:
NOTE: Plesk 9 repos are only available for rhel/centos 4 and 5
Enable Plesk 8.6 or 9.2? (8/9) [Default: 8]: 9
The Atomic Rocket Turtle archive has now been installed and configured for your system.
The following channels are available:
atomic - [ACTIVATED] - contains the stable tree of ART packages.
atomic-testing - [DISABLED] - contains the testing tree of ART packages.
atomic-bleeding - [DISABLED] - contains the development tree of ART packages.
Now run yum upgrade php to upgrade the PHP to the latest version:
[root#server ~]# yum upgrade php
The PHP upgrade process will commence & will finish within the next 5 minutes.
Finally execute these 3 commands to restart the web services & to accept the new PHP:
[root#server ~]# /etc/init.d/psa stopall
[root#server ~]# /etc/init.d/psa startall
[root#server ~]# /etc/init.d/psa restart
Now check the newer installed version of PHP using the php -v command.
I'm planning to use the following setup on EC2: PHP (recent version) plus memcached on an ec2 instance, and using Amazon's RDS service for the MySQL database.
Is there a recommended instance that has PHP and Memcached installed with the most often used php extensions? I am not much of a sysadmin and would prefer one that is already configured.
I don't know of any image that comes only with LAMP and memcached - but I setup something a while back - on a Amazon Linux AMI (which is a cut down centOS distro). You can always use this as a guide and set it up yourself (and create your own image afterwards).
DISCLAIMER: I'm doing this off memory- I might have missed a step or two here so read the error messages and figure out what is missing.
Install Apache, PHP, mySQL:
yum -y install httpd php mysql mysql-server php-mysql
Make sure this services start when you start your instances:
chkconfig httpd on
chkconfig –add mysqld
chkconfig mysqld on
Start apache and mySQL:
service httpd start
service mysqld start
Login to mysql and setup a root account. Create your DBs, setup users, remove test db etc.
Before we install memcached, you need to add EPEL repo to yum for extra centOS packages and then install some dependencies:
Create a new file /etc/yum.repos.d/epel.repo and paste:
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch/debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=0
[epel-source]
name=Extra Packages for Enterprise Linux 5 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/5/SRPMS
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=0
Install dependencies:
yum groupinstall "Development Tools"
yum install openssl-devel openssl
Now try installing memcached:
yum install memcached
Hope it helps