PHP

PHP is a scripting language designed primarily for web development, but it’s also widely used as a general-purpose programming language.

PHP subscription active
You will receive email notifications for new publications on PHP.
1494 Results
  • Question

    How to upgrade PHP 7.0.33 to 7.4.7 on Ubuntu 16.04 (NGINX)?

    My server configuration (DigitalOcen): * 4GB RAM | 80 GB Disk * Ubuntu 16.04 x64 (NGINX) - WordPress Current PHP version: 7.0.33 * Reason to upgrade: WordPress Error - PHP Update Required Kindly help. Thank you!
    Accepted Answer: Hi @chinmayrajyaguru, You can actually upgrade the PHP version, you can just install a new one. Firstly, to be able to install a certain PHP version, in this case, 7.2 you'll need to add a certain repository to your ...
    2 By chinmayrajyaguru Ubuntu 16.04 Nginx PHP WordPress
  • Question

    How to change caching_sha2_password to mysql_native_password on a DigitalOcean's Managed MySQL Database?

    I want to use the new DigitalOcean MySQL Managed Databases with my PHP application but I'm getting this error here: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; con...
    Accepted Answer: Hello, The easiest way to fix that would be to alter your existing user with the following: ALTER USER <^>myuser <^>IDENTIFIED WITH mysql_native_password BY '<^>mypassword<^>'; Another thing that you could do is to ...
    6 By bitmap Databases MySQL PHP WordPress
  • Question

    Upgrade PHP from 7.2 to 7.4 on CentOS 8 and Apache

    Hi all, I host 2 WordPress sites using Apache(httpd) on my droplet and am getting the nagging message to upgrade my version of PHP. I've found some tutorials and article on installing PHP, but nothing regarding upgrad...
    Accepted Answer: Hi @jplafata, In order to upgrade from one PHP version to another just need to install it. There is no actual upgrade process like upgrading from Ubuntu 16 to 18. You just install your new PHP version and make that th...
    2 By jplafata PHP Apache CentOS CentOS 8
  • Question

    How to install composer 2

    Hello https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-20-04 how to upgrade to version 2 ?? <^>command, composer self-update --2 , is not defined !!<^> Also as non root user:...
    Accepted Answer: Hi there, In case that you've installed composer with apt already you might have to remove the package first and then follow the steps from the tutorial: Remove the current installation: sudo apt remove composer Ins...
    1 By tjeumoonen Ubuntu PHP Ubuntu 20.04
  • Question

    #2002 - No such file or directory &mdash; The server is not responding (or the local server's socket is not correctly configured).

    When I try to login my PHPMyAdmin, I get the following error messages: ``` 2002 - No such file or directory &mdash; The server is not responding (or the local server's socket is not correctly configured). mysqlirealc...
    Accepted Answer: Hello, I would recommend changeinglocalhost to 127.0.0.1 in your config.inc.php PHPmyAdmin file. It should look something like this after the change: $cfg['Servers'][$i]['host'] = '127.0.0.1'; That way when using 12...
    2 By bepari662 MySQL PHP Apache Ubuntu 18.04
  • Question

    Why I can't install php5 modules on Ubuntu 16.04?

    Hello, I have just finished setting up my Ubuntu 16.4 server. I have installed php5.6.26 because I am going to use Wordpress and I am not sure if all plugins are compatible with php7. I need to install some php modu...
    Accepted Answer: As of Ubuntu 16.04.x default PHP version is PHP7. You should add PHP5 repository and you will be able to install it. First of all add repository : command sudo add-apt-repository ppa:ondrej/php When it finishes updat...
    2 By rodikr PHP Ubuntu 16.04
  • Question

    /etc/nginx/sites-enabled/default not found

    Hello, my friends. I have a problem and please help me. When I type sudo cat /etc/nginx/sites-enabled/default I get an error like this: cat: /etc/nginx/sites-enabled/default: No such file or directory How can I reso...
    Accepted Answer: Hi there, In addition to what @alexdo mentioned, I could also suggest checking the content of the /etc/nginx/sites-enabled/ as your config file might have a different name depending on your setup: ls -l /etc/nginx/si...
    2 By aslanhuseynov PHP Nginx Linux Commands Linux Basics Ubuntu 20.04
  • Question

    Create a dynamic database for each user using PHP

    Any suggestions on how we can create dynamic database for each user using PHP (as an when they register)? I am using the below code - it works on the local server, but not working in the live server on digitalocean. I...
    Accepted Answer: Hi there, Yes indeed if you are not using the root MySQL user it could be related to the privileges of the non-root user that you are using. What you could do is grant the user privileges to either all databases or be...
    1 By steveDolphin Databases PHP
  • Question

    Having issue with connecting DB cluster with phpmyadmin

    I have installed phpmyadmin in my centos8 droplet, and created an db cluster with same private network, I could connect db cluster through centos8 droplet terminal, however, I couldn't use phpmyadmin to connect the db...
    Accepted Answer: Hi there, In your PHPmyAdmin config, you need to also specify the database port as the Managed Databases run on a non-standard port. Another thing that could be causing the problem is if you've installed PHPmyAdmin wi...
    1 By karlhui CentOS 8 PHP DigitalOcean Managed MySQL Database
  • Question

    I cannot upload files to Ubuntu by php

    I am using the digitalocean droplet, ubuntu 20.04. I am using the php (Codeigniter) for my web application. When I tried to upload files, the uploading was not successful. After I change the upload directory permiss...
    Accepted Answer: Hi there @actionismostimportant, What you could do is to set the owner and the group of the files to the Apache user. That way you will be able to use 755 as the permissions. By default the Apache user is www-data if ...
    1 By actionismostimportant Ubuntu 20.04 Apache PHP
  • Question

    How to separate MySQL Server from LAMP

    i wanna have a server for php + apache2 and another server for MySQL. i installed everything in each server but how can the 2 servers communicate what should i do to let my web app in the apache server communicate wit...
    Accepted Answer: Hi there, You will first need to allow remote connections for your MySQL server. You can do that by following the steps here: https://www.digitalocean.com/community/tutorials/how-to-allow-remote-access-to-mysql After ...
    1 By IhebZanina LAMP Stack Apache PHP MySQL
  • Question

    Trying to install Latest PHP version on CentOS 7

    I've been trying to install the latest PHP version on my CentOS 7 droplet but every install keeps missing some key extensions. If I try to add them afterwards, there are some dependency failures which really bugs me....
    Accepted Answer: Hi @Remdore, So I ran into the same problem a day ago. Even if you install PHP 7.2 with yum something without any preparation always doesn't work right away. So, to install ANY PHP version you wish, you can follow the...
    1 By Remdore Apache PHP
  • Question

    How to get images to display on deployed laravel project on apps platform

    I recently deployed a small laravel app on the digital ocean apps platfrom and images I had saved in my public/images folder are't displaying. My image tag looks like so <img alt="image" src="{{ asset('images/port_s...
    Accepted Answer: Hi there @blaynebennett99, I could suggest a couple of things: Check the exact error that you are getting in your web console, it could be due to mixed content. If this is the case, then what you could do is force HTT...
    2 By blaynebennett99 Laravel DigitalOcean App Platform PHP PHP Frameworks Custom Images
  • Question

    How to install manually phpMyAdmin on Ubuntu?

    It is usually recommended to use distribution packages when possible - they usually provide integration to your distribution and you will automatically get security updates from your distribution. You can find a coll...
    Accepted Answer: There are a few ways of installing phpMyAdmin as described in the official documentation here: https://docs.phpmyadmin.net/en/latest/setup.html However I've been using another method which is a bit more convenient for...
    1 By bobbyiliev MySQL PHP LAMP Stack Apache
  • Question

    Why can't I connect to a remote MySQL server from a PHP application, but can connect from mysql-client

    Hi! I'm bamboozled. Here's the setup: * One application server, Ubuntu 18.04 LTS (PHP 7.2, mysql-client) * One database server, Ubuntu 18.04 LTS (mysql-server 5.7) I need to connect to the database from a PHP appl...
    Accepted Answer: Hello, This is quite interesting. As you are able to connect to the database with the mysql command, my guess would be that the password that you are using might not be correct, does your password have any special cha...
    1 By firestormbe352da97c3f50bea MySQL PHP Ubuntu 18.04
  • Question

    How to force Wordpress to recognize new PHP 7.4 install in ubuntu

    I have installed php7.4 and installed all the packages and updates. Rebooted my droplet, restarted apache, cleared all caches, etc. My server is running php version 7.4. But my wordpress installation is still using P...
    Accepted Answer: Hi @todderik, You need to tell Apache/Nginx to use the newly installed PHP verson. Apache You need to tell Apache to use the installed version of PHP 7.4 by disabling the old PHP module and enabling the new PHP module...
    3 By todderik WordPress PHP Ubuntu
  • Question

    IP address worked but domain name does not

    Domain name is registered and DNS is pointed to DO as per tutorial. Created "A" record for fireball.design and www.fireball.design and *.fireball.design. Also created Nginx server block for fireball.design in /etc/ngi...
    Accepted Answer: Tried the Fail2ban stuff but nothing worked and even uninstalled it. Tried lots of other things. I give up 3 weeks later for a simple LEMP stack with Wordpress. One click garbage installs. Can somebody delete this wh...
    4 By AndreyPavlov DNS Initial Server Setup LEMP Networking Nginx PHP WordPress Ubuntu 18.04
  • Question

    HTTP Error 500 NGINX Log PHP Wordpress Site

    Hi All, I have a HTTP Error 500 on one of our Droplet's NGINX Virtual Hosts: www.rjschauer.com The nginx error log shows: ``` 2021/01/20 03:56:54 [error] 321876#321876: *942104 FastCGI sent in stderr: "PHP message: P...
    Accepted Answer: The domain threw an HTTP 500, but the site did work when visiting domain.com/wp-login. Logging into Admin and updating Wordpress was all that was needed!
    2 By willbeing Nginx PHP WordPress
  • Question

    How to check if the exec() function is enabled in my PHP install

    I am NOT a technical person, so im trying to download a backup manager extension for my app on the droplet but it requires: the exec() function enabled in your PHP install since it will call a few command line comman...
    Accepted Answer: Hello, @adamSar If you've already configured the LAMP stack (Linux, Apache, MySQL, PHP) setup using our tutorial: How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 20.04 (https://www.digitalocean.com/co...
    2 By adamSar PHP LAMP Stack
  • Question

    Has anyone solved this error?A PHP Error was encountered Severity: Warning Msg: mysqli:real_connect(): (HY000/2002): Connection refused

    error 1 A PHP Error was encountered Severity: Warning Message: mysqli::real_connect(): (HY000/2002): Connection refused Filename: mysqli/mysqli_driver.php Line Number: 201 error 2 A PHP Error was encountered Severity:...
    Accepted Answer: Hello, It looks like that your server is running out of disk space. You can check that with this command: df -h My guess would be that the server ran out of space and MySQL crashed, that is why you are getting the f...
    1 By thiago20 MySQL PHP Ubuntu