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.
1344 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

    WP_DEBUG not working on any DO droplet

    I have used Wordpress instances on many servers from many different hosts and never had this issue. For some reason, only on Digital Ocean droplets, I am unable to turn on Wordpress logs, no matter what I do. Does any...
    Accepted Answer: Well the test of 'braking it' would be to ensure that the file itself is being honored, if so there is no reason PHP would not enable the logging unless its being turned off further down the stack somehow. Also, if yo...
    2 By devShrimp WordPress PHP Apache
  • Question

    What does the Droplet Backup service backup?

    I am using the Droplet Backup service for $0.14 dollars a month. I am fairly new in the development field and am not sure what to expect from this backup. The reason why I am asking this is that I want to be sure that...
    Accepted Answer: Hi there @katovonkatz, With the backups from DigitalOcean, your whole server gets backed up, meaning that you can restore your whole server including all of the server configuration and also website files and database...
    2 By katovonkatz Backups LAMP Stack WordPress PHP Ubuntu 20.04
  • Question

    How to install php7.4-gd in App Platform container?

    Is there a way to install php7.4-gd in the default container build step? I´ve tried: sudo apt-get install -y php7.4-gd Unfortunately I´m getting an error: sudo: effective uid is not 0, is /usr/bin/sudo on a file sy...
    Accepted Answer: You can install the GD extension by adding ext-gd to composer.json like so: [label composer.json] { "require": { "ext-gd": "*" } } The PHP build environment uses the Heroku PHP Buildpack, so you can ...
    1 By nightillusions DigitalOcean App Platform Docker PHP
  • Question

    403 Forbidden when changing index.html to index.php

    I hope someone can help me here. I just want to change the index.html to index.php, but when I do so I get the 403 forbidden error. I followed a bunch of tutorials on permission and installing php etc. to no avail. I ...
    Accepted Answer: Hi @karpred , I had to start new answer again :D Thanks for the latest result, and please provide one couple more. So, it will be two files: <^>get_me_and_remove_me_2<^> and <^>get_me_and_remove_me_3<^> 1. For <^>sudo...
    5 By karpred PHP Nginx Ubuntu
  • 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...
    1 By jplafata PHP Apache CentOS CentOS 8
  • 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...
    1 By todderik WordPress PHP Ubuntu
  • 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

    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 Upgrade php from 7.3 to 7.4?

    I am using OpenLiteSpeed 1 click WordPress on Ubuntu 20.04 My droplets, 2gb CPU 2gb RAM How to do this upgrade?
    Accepted Answer: you can try : ``` apt update apt-get -y install lsphp74 lsphp74-common lsphp74-curl lsphp74-dev lsphp74-imap lsphp74-intl lsphp74-json lsphp74-ldap lsphp74-mysql lsphp74-opcache lsphp74-pspell lsphp74-sqlite3 lsphp74-...
    2 By maximose PHP OpenLiteSpeed WordPress 1-Click WordPress Ubuntu 20.04
  • 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

    How to Setup Laravel with DigitalOcean Managed Redis Cluster?

    Redis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, and sorted sets. According to the official Laravel documentati...
    Accepted Answer: Prerequisites: In order to complete this tutorial, you will need: An Ubuntu Droplet with Laravel installed, you can follow the steps from this guide here on How to Install and Configure Laravel with LEMP on Ubuntu 18....
    1 By bobbyiliev Redis PHP PHP Frameworks Ubuntu Linux Basics Linux Commands
  • 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

    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
  • Question

    Domain Cannot Be Accessed in 12 Hours

    Hi, my blog cannot be accessed since last night. At first I thought it was due to excess CPU usage that it was down. That's why I tried resizing the droplets. But apparently not, because my other domains in the same d...
    Accepted Answer: Hello, I've tested your site and it seems to be loading as expected. I could suggest following the steps here on how to troubleshoot common Apache problems: https://www.digitalocean.com/community/questions/how-to-trou...
    1 By ombaldan PHP CMS Solutions Server Optimization DNS
  • 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

    Cannot get spaces to work with Laravel

    I am getting the following error: Missing required client configuration options: region: (string) A "region" configuration value is required for the "s3" service (e.g., "us-west-2"). Here is my setup (XXX to hide my ...
    Accepted Answer: Hi @Rwpeller Everything seems correct! Having said that, I do have one suggestion, when configuring : DO_SPACES_REGION=XXX In your .env file can you set it to be with Uppercase letters? WhatI mean is it should be l...
    1 By Rwpeller Laravel Block Storage PHP Ubuntu 20.04
  • Question

    PHP download created on the fly contains the source page's HTML

    I have a page that gives users the option of downloading some data (in JSON format, if that matters). I am making use of the PHP header command as shown below: ``` <html> <body> <?php $content = '{"employee": ...
    Accepted Answer: Hi @nycstern, It does seem like it's getting your html tags: <html> <body> If you remove them, the json file you create shouldn't have those tags in it. Having said that, you most probably will have more HTML ...
    1 By nycstern PHP
  • Question

    LAMP php mail only sending to gmail

    I have a droplet setup using the LAMP by DigitalOcean OS Ubuntu 18.04 framework (which includes Postfix), and in testing out the php mail() function, I find that sending or cc'ing email to a Gmail address works perfec...
    Accepted Answer: OK, so I configured Postfix to use my Gmail account as my SMTP server and all is good now. Still not sure why the email wasn't showing up in my inboxes before, but they are now! Hope this helps someone...
    1 By g3logic Ubuntu 18.04 PHP