Posted in linux
636
12:30 am, June 1, 2022
 

Install PHP without Apache on Ubuntu

I was actually about to do some coding and then i got distracted with this annoying error on vscode.

I keep getting this error on vscode:

I had been ignoring it, but i thought fine, ill fix it and install php on the server. 

for some reason when installing php on ubuntu with apt it assumes that you also want to install the apache web server???

sudo apt install php

also installs:

apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libjansson4 liblua5.2-0 libsodium23 linux-image-4.15.0-99-generic linux-modules-4.15.0-99-generic
  php-common php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline ssl-cert

No.. I just want php thanks.

sudo apt remove php

So you need to install php cgi 1st and then you can install php without it installing the apache server as well. 

sudo apt install php-cgi

and then 

sudo apt install php

now locate the php location

whereis php
php: /usr/bin/php7.4 /usr/bin/php /usr/lib/php /etc/php /usr/share/php7.4-common /usr/share/php7.4-readline /usr/share/php7.4-opcache /usr/share/php7.4-json /usr/share/man/man1/php.1.gz

Now add it to settings json in vscode

{
    "php.validate.executablePath": "/usr/bin/php7.4"
}

Hopefully no more errors finding php.

View Statistics
This Week
221
This Month
776
This Year
4192

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Items in linux
php error feed errors: XML or PCRE extensions not loaded! Identify which IPs are driving connections: check nginx access logs for bots show established connections in linux ubuntu check connetions in linux every 10 seconds loop Fatal error: Uncaught Error: Call to undefined function mb_strlen() blocking ip range with ufw check and block connections script block ip address ranges on ubuntu linux with UFW list all network connections linux show all connections on linux command line add ssh keys on your linux box in 10 seconds Install PHP without Apache on Ubuntu add a user and add the user to sudo group add user to sudo group in ubuntu simple backup to google drive fron linux backup script to google drive that can be used for multiple directories start ssh and add key git play youtube videos on firefox in ubuntu 18 Creating a chart about charts.css with charts.css from the command line linux mount a drive manually installing exfat and ntfs drivers to enable reading of these filesystems linux list all drives and partitions how to check the temperature of the pi using command line how to check linux kernel version on rasberry pi rasberian how to find what version pi you are using change file permissions to -rw-rw-r-- install atom editor on ubuntu Enabling SSH on Ubuntu certbot add a certificate for one domain renew all SSL certificates with certbot To make Ubuntu do nothing when laptop lid is closed add a user to a group loop through each directory in a target directory and compress them loop through each directory in a target directory tar.gz to compress a directory in linux and then decompress it Find Disk Space Usage using DU how to unzip in linux
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote


Random CSS Property

font-family

The font-family CSS descriptor allows authors to specify the font family for the font specified in an @font-face rule.
font-family (@font-face) css reference