php – WordPress mysql deos does not work with php7

I have a vps with these specifications:
CPU Model: Intel (R) Xeon (R) CPU E5-2630 v4 @ 2.20GHz
CPU details: 4 cores (2200 MHz)
Distribution name: CentOS Linux version 7.6.1810 (Core)
RAM memory: 8 GB

I'm running the Centos web panel on it, I have two WordPress websites, one (which has the problem, I think) has more than 30,000 posts, and the other has 6000 posts.

when I run the server in php5.6 everything goes fine, but the CPU load is high, and when I update it to php7, the CPU load became lower and nice for about 8 hours and suddenly a Query Run and the CPU load became 100% and my websites fall.
I don't know why, I tried many solutions but nothing happened. Can someone help me please!!

The query: https://imgur.com/a/7lZXjc2
My active add-ons: https://imgur.com/u7hshya
Topic: Editor Version 7.6.0

  • I am using the same theme and add-ons on both websites, but only the one with 30,000 posts is causing the problem.

Problem with php7 switch

I am practicing with the news of php7 compared to php5 and I encountered this problem when using the triple track comparator <=> and switch, since I get an incorrect result when I print the result on the screen or console, I leave the code, I hope you can explain why this behavior.

 $foo) {
case 0:
   echo "$bar and $foo are equal";
case -1:
   echo "$foo is bigger";
case 1:
   echo "$bar is bigger";
 }
 ?>

This is the result:

$ php numero1.php
$foo is bigger$bar is bigger

php7 – How to execute the same function in a for php?

I have 2 methods, in the first I bring multiple databases, I go through them with a cycle for to store one by one in an array and in this way pass it to the second method which will make the process of connecting to the database, bring the information through it and download it into a file excel.

THE PROBLEM

At the moment I have 3 connections, but when executing the second method that does almost the entire process, it only downloads a file of excelIt's as if the first cycle for that has the 3 connections will not execute the same method 3 times, why does this happen?

CODE

// Method that I execute directly
public function index ()
    {
        $ resp = $ this-> Welcome_model-> getClinicas ();

        for ($ i = 0; $ i < count($resp); $i++):
            $data[$i] = [
                    'host'   => $ resp[$i]-> cli_host,
                    'dbname' => $ resp[$i]-> cli_dbname,
                    'user' => $ resp[$i]-> cli_user,
                    'pass' => $ resp[$i]-> cli_pass,
                    'port' => $ resp[$i]-> cli_port,
                    'driver' => $ resp[$i]-> cli_driver,
            ];


            $ this-> executeFile ($ data[$i], $ resp[$i]-> rep_query, $ resp[$i]-> rep_name);
        endfor;
    }

public function executeFile ($ data, $ query, $ name) {
            $ this-> load-> library ('connection');
            $ this-> connection-> connect ($ data);

            $ stmt = $ this-> connection-> prepare ($ query);
            $ stmt-> execute ();
            $ result = $ stmt-> fetchAll (PDO :: FETCH_ASSOC);

            $ columns = array_keys ($ result[0]);
      // Starting the PHPExcel library
        $ this-> load-> library ('excel');
        // $ this-> load-> library ('PHPExcel / IOFactory');

        $ this-> excel = new PHPExcel ();
        $ this-> excel-> getProperties () -> setTitle ("export") -> setDescription ("none");

        $ this-> excel-> setActiveSheetIndex (0);

        // Field names in the first row
        $ fields = $ columns; // $ query-> list_fields ();
        $ col = 0;
        foreach ($ fields as $ field)
        {
            $ this-> excel-> getActiveSheet () -> setCellValueByColumnAndRow ($ col, 1, $ field);
            $ col ++;
        }

        // Fetching the table data
        $ row = 2;
        foreach ($ result as $ data)
        {
            $ col = 0;
            foreach ($ fields as $ field)
            {
                $ this-> excel-> getActiveSheet () -> setCellValueByColumnAndRow ($ col, $ row, $ data[$field]);
                $ col ++;
            }

            $ row ++;
        }

        $ this-> excel-> setActiveSheetIndex (0);

        $ objWriter = PHPExcel_IOFactory :: createWriter ($ this-> excel, 'Excel5');

        // Sending headers to force the user to download the file
        header ('Content-Type: application / vnd.ms-excel');
        header ('Content-Disposition: attachment; filename ='. $ name. '. xls');
        header ('Cache-Control: max-age = 0');

        $ objWriter-> save ('php: // output');
    }

php7 – Error in laravel routes

I am creating a laravel multi-language site, I need to create two groups of routes that allow me to process requests like mydomain.com/language or mydomain.com/pais/language, for that in the web.php file (of routes) I added the following:

$ myroutes = function () {
    Auth :: routes ();
};

Route :: group (['prefix' => '{country}/{language}', 'where' => ['language' => '[a-zA-Z]{2} ',' country '=>'[a-zA-Z]{two}'], 'middleware' => 'setlocale'], $ myroutes);

Route :: group (['prefix'=>'{language}''where'=>['language'=>'['prefix'=>'{language}''where'=>['language'=>'['prefix'=>'{language}''where'=>['language'=>'['prefix'=>'{language}''where'=>['language'=>'[a-zA-Z]{two}'], 'middleware' => 'setlocale'], $ myroutes);

The problem I have is that whenever I ask or do a redirect like this:

route ('login',[$request->language, $request->country]);

I'm going to the route:

mydomain.com/idioma/login?pais

That is, it always falls in the group:

Route :: group (['prefix'=>'{language}''where'=>['language'=>'['prefix'=>'{language}''where'=>['language'=>'['prefix'=>'{language}''where'=>['language'=>'['prefix'=>'{language}''where'=>['language'=>'[a-zA-Z]{two}'], 'middleware' => 'setlocale'], $ myroutes); 

Does anyone know what it could be?

php7 – Answer "no" in "restart services during package updates without asking"? Affect unattended updates?

I answered no when I was doing an interactive update check on 18.04 and this happened:

"There are services installed on your system that must be restarted when certain libraries are updated, such as libpam, libc, and libssl Since these restarts can cause interruptions in the system service, you will usually be prompted to update each update. you want to restart, you can choose this option to avoid being asked, instead, all the necessary restarts will be done automatically so that you are not asked questions in each library update. "

But I wonder if this is now a global "no" for any Updates, particularly those of security made by unattended updates. I'm thinking about php 7.x, for example, if that is repaired and it does not restart, and it breaks, then php is not running.

If php, apache, mysql, etc. they have their own postinst scripts that restart the services and ignore my "no", then that's fine. If not, how can I reverse what I did?

I can not get php7 after adding ppa: ondrej / php

I added the repository by this command:

WARNING: add-apt-repository breaks with regional settings that are not UTF-8, see
https://github.com/oerdnj/deb.sury.org/issues/56 for the solution:

More information: https://launchpad.net/~ondrej/+archive/ubuntu/php
press [ENTER] to continue or ctrl-c to cancel add it

gpg: keychain /tmp/tmph7kev8sf/secring.gpg & # 39; created
gpg: keychain
/tmp/tmph7kev8sf/pubring.gpg & # 39; created
gpg: requesting the key E5267A6C from the server hkp keyserver.ubuntu.com
gpg: /tmp/tmph7kev8sf/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
IN AGREEMENT

everything looks good then I run apt-cache

what does not give anything

This is my system information:
~ # uname -a
Linux cspweb 3.13.0-123-generic # 172-Ubuntu SMP Mon June 26 18:04:35 UTC 2017 x86_64 x86_64 x86_64 GNU / Linux

place
LANG = en_US.UTF-8
LANGUAGE =
LC_CTYPE = "en_US.UTF-8"
LC_NUMERIC = "en_US.UTF-8"
LC_TIME = "en_US.UTF-8"
LC_COLLATE = "en_US.UTF-8"
LC_MONETARY = "en_US.UTF-8"
LC_MESSAGES = "en_US.UTF-8"
LC_PAPER = "en_US.UTF-8"
LC_NAME = "en_US.UTF-8"
LC_ADDRESS = "en_US.UTF-8"
LC_TELEPHONE = "en_US.UTF-8"
LC_MEASUREMENT = "en_US.UTF-8"
LC_IDENTIFICATION = "en_US.UTF-8"
LC_ALL =

I even try LC_ALL = C.UTF-8 add-apt-repository to ppa: ondrej / php, the same result. Any suggestions and suggestions are greatly appreciated.

PHP7 I use a mysql query in php and it gives me a different value than if I do it in phpMyAdmin

I have this query =

SELECT
- tags_in_messages.id AS 'EM_id',
- tags_in_messages.id_message AS 'EM_id_message',
- tags_in_messages.id_tag ​​AS 'EM_id_tag',
 messages.id AS 'message_id',
 messages.title AS 'message_title',
 messages.content AS 'message_content',
 messages.createAt AS 'message_createAt',
 messages.screador AS 'message_creator',
 messages.url_img AS 'message_url_img',
 Tags.id AS 'label_id',
 tags.name AS 'label_name'
DESDE
tags_in_messages,
messages,
labels
WHERE
tags_in_messages.id_message = messages.id
AND
tags_in_messajes.id_tag ​​= tags.id



ORDER BY
messages.id;

In HeidiSQL(a program like MySQL Workbench) gives me this result =
enter the description of the image here

But if I do it with PHP look what I get, exactly with the same query:

$ sql =
"SELECT
- tags_in_messages.id AS 'EM_id',
- tags_in_messages.id_message AS 'EM_id_message',
- tags_in_messages.id_tag ​​AS 'EM_id_tag',
 messages.id AS 'message_id',
 messages.title AS 'message_title',
 messages.content AS 'message_content',
 messages.createAt AS 'message_createAt',
 messages.screador AS 'message_creator',
 messages.url_img AS 'message_url_img',
 Tags.id AS 'label_id',
 tags.name AS 'label_name'
DESDE
tags_in_messages,
messages,
labels
WHERE
tags_in_messages.id_message = messages.id
AND
tags_in_messajes.id_tag ​​= tags.id



ORDER BY
messages.id;

";

if ($ result = $ connection-> query ($ sql)) {
    var_dump ($ result);
    while ($ row = mysqli_fetch_array ($ result)) {
        echo 'MESSAGE_ID ='. $ row['mensaje_id']. "<br";
        echo 'MESSAGE_TITLE ='. $ row['mensaje_titulo']. "<br";
        echo 'MESSAGE_CONTINUED ='. $ row['mensaje_contenido']. "<br";
        echo 'MESSAGE_CREATEAT ='. $ row['mensaje_createAt']. "<br";
        echo 'MESSAGE_CREATER ='. $ row['mensaje_creador']. "<br";
        echo 'MESSAGE_URL_IMG ='. $ row['mensaje_url_img']. "<br";
        echo 'LABEL_ID ='. $ row['etiqueta_id']. "<br";
        echo 'EITQUETA_NOMBRE ='. $ row['etiqueta_nombre']. "<br";
    }
}

I really do not understand how I can get a result so different between one and another. Excuse my ignorance about it, but I have not managed to fix that.

247-Host: SSD | US Canada Europe Asia Datacenter | LiteSpeed ​​| SSL free | PHP7 | CloudFlare | 50% OFF

247-Host is a privately owned Canadian company that has provided reliable, affordable shared hosting, hosted resellers, VPS and dedicated servers since 2004.

SPECIAL OFFER OF HOSPEDAJE OF 50% OF THE PRICE OF THE ORDER

We are offering a 50% discount on the price of the order in all hosting plans. Simply use the coupon code: WHT50 during the order process. This coupon will give you a 50% discount on the first invoice. The discount is applied in the payment process (Step 3, during the order process).

CHOICE OF LOCATIONS OF THE DATA CENTER EE. USA, CANADA, EUROPE AND ASIA

  • Chicago, United States
  • Los Angeles, US
  • Miami, United States
  • Phoenix, USA
  • Dallas, United States
  • Montreal Canada
  • London, United Kingdom
  • Amsterdam, Holland
  • Singapore, Asia (available with our Business SSD plans)

Coming from another host? We will transfer your data for free.

FEATURES INCLUDED WITH ALL PLANS.:

– Web hosting based on Cpanel
– LiteSpeed ​​web server with WordPress Cache
– MariaDB databases (MySQL) UNLIMITED, email, FTP accounts
– FREE unlimited SSL Auto (Let's encrypt)
– Choose from multiple versions of PHP (4.4, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 7 and 7.1)
– Softaculous 1-Click Script Installer
– WordPress, OpenCart, PrestaShop, Drupal, Joomla, phpBB, Magento, Dolphin and much more.
– RvSiteBuilder Pro
– SEO Attracta Tools
– CloudFlare with Railgun
– CloudLinux
– Ffmpeg (available with Business SSD plans)
– Support 24/7/365
– 99.9% guaranteed server uptime
– Virus and malicious protection.
– DDOS protection enabled.
– No contracts, no captures
– 45 day money back guarantee

Silver $ 4.99 / month (regular price) ***with WHT50 coupon $ 2.49 / month***
Disk space: UNLIMITED
Bandwidth: UNLIMITED
Allowed domains: 2
CPU cores: 1
ORDER NOW: http://www.247-host.com/plans.html

Gold $ 6.99 / month (regular price) ***with WHT50 coupon $ 3.49 / month***
Disk space: UNLIMITED
Bandwidth: UNLIMITED
Allowed Domains: UNLIMITED
CPU cores: 1
ORDER NOW: http://www.247-host.com/plans.html

Business SSD hosting plans

Are you looking for speed and performance 20 times faster? Check our SSD plans for companies that are hosted on Pure SSD drives and designed for high traffic websites with a low number of clients per server. NOW OFFERING SINGAPORE DATACENT LOCATION !!

Beginner $ 9.99 / month (regular price) ***with WHT50 coupon $ 4.99 / month***
Pure SSD space: 20GB
Bandwidth: UNLIMITED
Allowed Domains: UNLIMITED
CPU cores: 1
Memory: 1GB
SSH access
ORDER NOW: http://www.247-host.com/business-ssd-hosting.html

Small $ 19.99 / month (regular price) ***with WHT50 coupon $ 9.99 / month***
Pure SSD space: UNLIMITED
Bandwidth: UNLIMITED
Allowed Domains: UNLIMITED
CPU cores: 2
Memory: 2GB
SSH access
ORDER NOW: http://www.247-host.com/business-ssd-hosting.html

Medium $ 29.99 / month (regular price) ***with WHT50 coupon $ 14.99 / month***
Pure SSD space: UNLIMITED
Bandwidth: UNLIMITED
Allowed Domains: UNLIMITED
CPU cores: 3
Memory: 3GB
SSH access
ORDER NOW: http://www.247-host.com/business-ssd-hosting.html

Large $ 39.99 / month (regular price) ***with WHT50 coupon $ 19.99 / month***
Pure SSD space: UNLIMITED
Bandwidth: UNLIMITED
Allowed Domains: UNLIMITED
CPU cores: 4
Memory: 4GB
SSH access
ORDER NOW: http://www.247-host.com/business-ssd-hosting.html

Speak with us: Click here

This is what our customers have to say about us …

http://www.webhostingtalk.com/showth…st#post9736401

https://www.facebook.com/247host/posts_to_page/

247-Host In 2019: What Do 247-Host Client Reviews Say?

Jack – heartandsoulwebdesign.com

I can not believe the customer service in this company! ALL THE PIECE until the end. I would recommend them highly!

Sandy – 99pennyhosting.com

Solid support, our business depends on these guys and they always happen. Thank you.

Greg – roundrocksetc.com

I just want to say that if you are looking for accommodation here, you have come to the right place. I have been using 247-Host since April 2004 and

I could not be happier with the service and support. His activity time has been excellent and the prices are exceptional. Take them in their offers, years from

Now you will be glad you did.

Bryan – retrogamingtimes.com

247-host has always been there when I needed them, 7 days a week / 24 hours a day. They have solved all the problems I had with promptness and courtesy. I

I have tried with other hosting providers in the past, and they are by far the best. The use of 247-host to support / provide server space for my company has been one of

The best decisions I have made.

Adam – 20minuteteethwhitening.com

In the last 12 years, I have used the facilities of three other lodging companies that range from expensive to low cost and I have discovered the difficult way.

That in the case of the highest cost, it does not always guarantee an excellent service.
247-Host is, for me, the "best of the best" and I do not say it lightly. The facilities used and the service I received have been first class.

It turned out to be everything I need from a host, and more. Thank you.

Mazen- reefnethost.com

247-host gives the best of the best in the field. So, whatever you are looking for. From the hosting of a single site to the dedicated servers, simply choose, obtain and

Go and you will be more than satisfied.

Shaun – liverocknreef.com

I have some clients that host with 247-Host and all I can say is that they are ROCK! The hosting is very reliable, the server speeds are excellent and the support

is incredible! I have been a web developer for 15 years and these guys are first class.

Do you have any questions? Do not hesitate to contact our sales department through live chat, sales by email [at] 247-host.com or call us at 1-877-791-3474

php7 – PHP 7 error with a week array

it is not possible to create a array $ day in which I keep the days of the weeks so that:

$ day[] = "Monday";
$ day[] = "Tuesday";
$ day[] = "Wednesday";
$ day[] = "Thursday";
$ day[] = "Friday";

And then when you want to access a certain position simply put a index within the brackets [] For example:

this : $ day[2] should be Wednesday.

Why it does not work?

php – updated to PHP7 on Windows: php_soap.dll causing frequent crashes / errors 500

I have two servers, a test server running Windows 7 … and a prod server running Windows Server 2008. (Yes, it's unfortunate that they are different operating systems).

For months, they have been running in PHP 5.4.1.4.

I decided to update them to PHP 7. Everything went completely fine with the test box. But of course, it does not get much traffic.

In the box prod / Windows Server 2008, it seems that web applications would run for one or two minutes and then show "500 errors". I could freshen up and, sometimes, they would work again, sometimes it would take me a few minutes.

Nothing has been written or written in the NEW PHP error log (although the IIS PHP Manager section showed that we were given the correct INI and the correct log file).

The failed web server application records simply indicated that FastCGI was failing due to too many 500 errors.

I checked the Event Viewer and would see application crashes that would point to php_soap.dll.

Now, that file is HERE and has the same size as the one I have in non-prod.

Still, I thought maybe it was because my scripts were receiving 500 errors for a valid reason. So I investigated one of them. He confirmed that it was an exact match with a working one in the test box. Renovated … and it worked well. Refreshed a little more, 500 errors.

Then, finally, I went into the IIS Manager -> PHP Manager and disabled the SOAP extension.

Then, I stopped seeing the massive number of failed requests and I stopped seeing the 500 errors … for everything, except the script that I have that makes SOAP calls.

I tried to copy the dll from the test box to the prod box. Enabled the extension again in PHP. The problem returned. Therefore, I have gone back to the 5.4.1.4 configuration for now.

Any ideas on how I can find out why this dll is causing problems and / or how to fix it?

Thank you!

– = Hudson = –