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.
1203 Results
  • 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

    How to add an Lets encrypt certificate dynamically using CNAME verification?

    I have been working on a web app where users can create custom profiles of them and see it on their custom domain by adding an A record and CNAME record. If they have their profile on https://webapp.com/profile they c...
    Accepted Answer: Hello, If I understand this correctly, it sounds like that you need some kind of automation to create a new Nginx server block for each website, and then install the Let's Encrypt SSL certificate for the new domain. T...
    1 By Cybil Apache PHP MySQL Ubuntu 18.04 Security
  • Question

    Running "artisan cache:clear" writes the cache files as root

    We have a web application that runs Laravel. And whenever we run the "artisan cache:clear" command, it writes new cache files and folders owned by root. We've changed ownership of the parents folders up to the /var/w...
    Accepted Answer: What user is your app running as? I am going to answer this question as if you do not know much about Linux, so I apologize if I am saying anything you already know. When you type ps aux in a cli, what User does it ...
    1 By coj PHP PHP Frameworks
  • Question

    How to enable php-mbstring and php-soap on my Ubuntu 18.04 droplet

    Running WordPress w/WooCommerce on a Ubuntu 18.04 droplet with PHP 7.4.2. A WooCommerce Square payment add-in is not accepting payments. The WooCommerce website status is reporting 2 errors: Your server does not su...
    Accepted Answer: Hi @mdkennedy, It does seem like you have mbstring and SOAP enabled on your PHP version. It's possible however your website is actually picking up another PHP version. You can confirm this by creating a info.php file ...
    1 By mdkennedy LAMP Stack PHP
  • 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 devdojo Databases MySQL PHP WordPress
  • 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

    how do I enable getimagesize and CURL?

    What's the CentOS server command to enable getimagesize and CURL? Or the command to check if they are enabled? I need these both enabled for a WordPress plugin I'm using.
    Accepted Answer: Hello, You can enable those PHP modules by running to following commands: yum install curl yum install php-curl Regarding the getimagesize function, I think that you need to enable allow_url_fopen in your php.ini fi...
    1 By justsomebaw CentOS PHP WordPress
  • 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

    Fresh WordPress install Showing WSOD (White Screen of Death)

    I am running Debian Buster with Nginx, PHP 7.3 and the latest WP v. 5.3.2. Everything works as it should in my local test env. When I push things to my DO droplet it gets wonky. My site works in full – and I can login...
    Accepted Answer: *** SOLVED *** I discovered (belatedly) that the pages were actually loading, just unable to render. Found Content-Security-Policy errors and traced it back to this line in my nginx config for this site. ``` add_heade...
    3 By kerns WordPress PHP Nginx
  • Question

    How to reboot a Droplet with DigitalOcean API - PHP, Python, BASH examples?

    Recently someone asked me how to reboot a Droplet with the DigitalOcean API so I decided to put to together a few examples on how to do that with different scripts including: PHP script Python script BASH script And l...
    Accepted Answer: According to the official API documentation, you can reboot a droplet with the following curl request: curl -X POST -H "Content-Type: application/json" \ -H "Authorization: Bearer <^>API_TOKEN_HERE<^>" \...
    1 By bobbyiliev API Python Linux Basics PHP
  • Question

    Cannot change root of web site with Apache2 Virtual Hosts directive

    I need to have this site's root be /var/www/examplesite/docroot/ Running SSL with a Let's Encrypt certificate, and heavy .htaccess file in /var/www/examplesite/docroot Whenever I run phpinfo() it tells me that the DOC...
    Accepted Answer: Hello, @journeyintosound Have you restarted Apache once you've made the changes to the Virtual Hosts? Also before doing this you can check for any syntax errors in the configuration file using the following command: ...
    1 By journeyintosound Ubuntu 18.04 PHP Apache Drupal
  • Question

    How to configure Laravel 5.7 with Redis TLS (Using phpredis)

    Hi I'm using laravel 5.7 with phpredis (PHP 7.2), but I’m not able to get it to work with tls, I am trying to use it with digitalocean Redis managed database which only supports tls connections. Any idea if tls even s...
    Accepted Answer: So I managed to get this to work, basically the current phpredis version that is shipped with php 7.2 (Ubuntu 18) is old and does not support tls, to fix this I had to update phpredis from pecl (https://pecl.php.net/p...
    2 By ahmadt Redis Databases PHP PHP Frameworks
  • Question

    Phpmyadmin or Alternative for PHP7 + Nginx + MySql 5.7 + Ubuntu 16.04

    Hello, I have been reading up on the tutorials and some of the comments on the community pages but I would like to know if there are any better alternatives or any advice to better manage my databases. I use Phpmyadmi...
    Accepted Answer: Phpmyadmin does support PHP 7 and Mysql 5.7. I recommend you to grab latest release from their download page (https://www.phpmyadmin.net/downloads/). Current download link is: https://files.phpmyadmin.net/phpMyAdmin/4...
    2 By Lilap Nginx MySQL PHP Ubuntu 16.04
  • Question

    How to connect into DB cluster with PhpMyAdmin ?

    I had DB cluster and was successfully connected remotely via new droplet with MySQL 8 installed on there. ``` root@confidential:~# mysql --version mysql Ver 8.0.18 for Linux on x86_64 (MySQL Community Server - GPL) r...
    Accepted Answer: Well lucky me i was able to figuring out the problem. it's the additional PhpMyAdmin configuration which cause the problem. After i'm editing the additional configuration became : $i++; $cfg['Servers'][$i]['host'] = ...
    2 By mangprangstore Databases PHP
  • 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

    Nginx best high performance caching configuration for WordPress

    I am planning to deploy an optimized LEMP stack on DigitalOcean on Ubuntu 18.04 for my WordPress site. I have many question and confusion related to caching. I hope I will get all my answer here. Are PHP-FPM and Varni...
    Accepted Answer: Hello, I'll try to answer all of your questions: PHP-FPM and Varnish are not the same in any way, you should not confuse the two, they can not substitute each other. Varnish is simply a HTTP accelerator it would simpl...
    1 By techiebraj Nginx PHP Caching WordPress Server Optimization 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

    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...
    3 By AndreyPavlov DNS Initial Server Setup LEMP Networking Nginx PHP WordPress Ubuntu 18.04
  • Question

    Composer install not working with user_data setup script

    Hi, I'm trying to setup an automated script that should basically be able to automatically clone a project from my Github and install its dependencies via Composer. Here is a simple version of the user_data that I'm s...
    Accepted Answer: I finally found my solution It turns out that while running the composer-setup.php through a setup script, this message will appear: The HOME or COMPOSER_HOME environment variable must be set for composer to run cor...
    2 By MartinMarx Automated Setups PHP DigitalOcean
  • Question

    Upgrade php on Ubuntu 14.04

    Wordpress now requires php 5.6 or higher and I just can't get it to update on my Ubuntu 14.04 droplet, I've tried dozens of tutorials but always get a Unable to locate package php5.6 or similar message. Every tutorial...
    Accepted Answer: I tried with php 7, 7.2 and 7.3 all of which gave me the same Unable to locate package message. I also tried apt-cache search php and couldn't see any php7 in there. I'm pretty lower level with linux so am quite possi...
    2 By devolved PHP Ubuntu