I am new using Ubuntu. Basically I want to set the LAMP package in order to test PHP locally. So I installed tasksel then I executed in the terminal.
sudo tasksel
Which promps a list of servers I can install. I move the cursor to LAMP Server option, hits enter and returns to the command line. Like if I had pressed EXIT.
What am I missing? Can someone experienced help me install LAMP even if it is on another way? I have Ubuntu 13, by the way. I have been struggling with this for a while now.
You can try with.
sudo tasksel install lamp-server
https://help.ubuntu.com/community/ApacheMySQLPHP
To install apache, open terminal and type in these commands:
sudo apt-get update
sudo apt-get install apache2
to test if apache is working use this simple script:
ifconfig eth0 | grep inet | awk '{ print $2 }'
and browse to : http://<you'r ip address>
to install mysql open the terminal and write this:
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
Once you have installed MySQL, we should activate it with this command:
sudo mysql_install_db
Finish up by running the MySQL set up script:
sudo /usr/bin/mysql_secure_installation
The prompt will ask you for your current root password.
Type it in.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Now, its time to install PHP:
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
That's it! restart apache to apply the changes:
sudo service apache2 restart
Hope it helps.
Change user to root
sudo su root
update the repository
sudo apt-get update
install LAMP packages by,
apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-mysql
This three simple step is enough to install LAMP.
Courtasy: iGyan: Install LAMP with PHPmyadmin in linux
You can easily install LAMP stack in Ubuntu with one command lines:
apache2 mysql-server mysql-client libapache2-mod-auth-mysql php5 php5-mysql libapache2-mod-php5 php5-mcrypt php5-curl php5-cli php5-gd phpmyadmin apache2-utils
Related
I have been trying to update PHP on my install of WordPress on Google Cloud.
I have followed these instructions: How do I upgrade from PHP 7.0 to 7.3 on google cloud platform?.
When I do a php -v command, it shows that it is updated, but within WordPress it is still showing version 7.0, not the updated version.
Your system appears to have two installations of PHP. One for the CLI and another Apache or you have not restarted Apache after the update. First restart Apache and recheck.
The command to install Apache PHP is sudo apt install libapache2-mod-php7.3.
Warning: Be careful with manual updates of PHP and other software that may have interdependencies. Make sure you have backed up your system (image) before so that you can recover is something goes wrong. Debian 4.9 is very old (obsolete) and might not be supported or even tested with the latest versions of third-party software.
The Linux command where php will tell you where PHP is installed. To figure out if you have a different installation for Apache, create a new web page, such as myphpinfo.php with the following contents. Then use your browser to view the page:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
Your browser will display a page like this:
Use SSH commands:
Go to root
sudo -i
install latest version of php
apt-get install php7.4
update it
apt-get update
install packages
apt-get install ca-certificates apt-transport-https
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list
check your php version
php -v
enable php7.4 and disable your current php7.0
sudo a2dismod php7.0
sudo a2enmod php7.4
install the libraries
sudo apt-get install phpmyadmin php-mbstring php-gettext
sudo apt-get install php-mysql
sudo apt-get install php-curl
sudo apt-get install php-xml
sudo apt-get install php-gd
restart apache
sudo service apache2 restart
This question already has answers here:
PHP code is not being executed, but the code shows in the browser source code
(35 answers)
Closed 6 years ago.
so i've started by setting up apache2 up on my ubuntu server. However it seemed to work fine however it did only show index.php as plain text, so i tried to use following command sudo apt-get install libapache2-mod-php5 and now it just show nothing when i access my server. it should be said that i've changed the listener port in ports.conf to 5055. Why am i not getting anything after installing libapache2?
so in order what i've done is
sudo apt-get install apache2
sudo nano /etc/apache2/ports.conf
sudo service restart apache2
sudo apt-get install libapache2-mod-php5
Try these. You might be missing something.
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo apt-get install php5 php5-mysql php-pear php5-gd php5-mcrypt php5-curl
This was taken from TrueSpot Media - https://www.truespotmedia.com/install-lamp-linux-apache-mysql-php-ubuntu/
Try running the following:
sudo apt-get install php5
sudo service restart apache2
If I am right however in assuming you are running Ubuntu 16.04, please instead run the following command:
sudo apt install php libapache2-mod-php
I am trying to setup LAMP stack on Ubuntu 14.04 LTS by installing each of the packages seperately in terminal and not by using LAMP software bundle packages. The following are the commands that I executed:
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install mysql-server
sudo apt-get install phpmyadmin
Is there any other configuration that needs to be done like configuring the apache2 server, phpmyadmin, etc... I looked it up on google and unable to find recent results.
Appreicate your help
Edit: Updated the query with more information
Go in the apache2 config file by typing:
sudo nano /etc/apache2/apache2.conf
Then, type the following and save the file:
Include /etc/phpmyadmin/apache.conf
Now, restart the apache2 server by typing:
/etc/init.d/apache2 restart
I'd like to know a basic run down of command line inputs to install Apache, PHP and a SQL database on a VPS.
I'm not sure if sudo apt-get install php5 is enough to install php5 while getting the dependencies such as gcc.
I'm looking at Debian (Wheezy) as that is what a friend of mine suggested. I'm testing different websocket/wamp router solutions probably alongside if not dependent on node.js eg. socket.io or crossbar.io.
sudo apt-get install mysql-server
sudo apt-get install apache
sudo apt-get install php5-common libapache2-mod-php5 php5-cli
There are additional instructions for installing the mysql-server:
http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/
I am new to this of course.
I am trying to configure PHP and Apache on a new Amazon EC2 AMI. This is a very lightweight server so the Micro instance fits the bill.
I just need
Apache
PHP
I ran
sudo yum install apache2
sudo yum install php
I copied info.php to /var/www/html
info.php only contains
<? phpinfo(); ?>
when i browse to http://www.example.com/info.php Apache serves info.php but it does not render it. I looks like apache is not configured to handle php files. What step or steps am I missing?
Thanks,
First try using full tags, so your script would be.
<?php phpinfo(); ?>
instead of <? ?>
If no luck, try:
sudo yum remove php
sudo yum install php
then service httpd restart
Alternatively try using one of the pre-built AMI's. Community AMI's have several LAMP configurations.
Just for those who get here from Google, try this:
sudo yum install -y php
sudo yum -y install httpd
If you need development versions:
sudo yum install -y php-devel
sudo yum -y install httpd
If you need Apache 2.4 and PHP 5.4:
sudo yum install -y php54
sudo yum -y install httpd24
From:
Install Apache, PHP, and MySQL on Amazon Linux
Install Apache 2.4, PHP 5.4, and MySQL on Amazon Linux
Just tar your info.php;
Upload it to another public directory;
Get the file to ec2 with wget;
Untar the file.
That's it ;)