Tag Archives: php

SMTP Error: The following recipients failed

Describe the problems I encountered:
After receiving phpmailer, The following Error was reported: SMTP Error: The following Error was received: XXXX Server Error: ‘4.7.1 < mail address sending to> Relay access denied’
I put the code in the same room with SMTP server on the machine can normal to send, after the change back to ali cloud is an error, I am depressed, Google once met this question a lot, but haven’t been able to solve my problem, and then I try to modify the inside of the phpmailer configuration, after changing the SMTPAuth to true unexpectedly send mail properly, the original is useless authentication out of wrong, but I in another machine SMTPAuth is false is normal, don’t know the reason why is it the same room so no authentication is required

No Internet access error 137 (net::ERR_NAME_RESOLUTION_FAILED): Solution to unknown error

Internet Explorer, Chrome can’t surf the Internet, but Firefox can, QQ and other clients can also surf the Internet.

chrome error code: error 137 (net::ERR_NAME_RESOLUTION_FAILED): unknown error.

thought it was a DNS resolution problem, so it changed to 8.8.8.8 8.8.4.4 and so on. I can’t.

the reason is that I installed a local PHP running server: APMServ5.2.6. After using its software conflict resolution feature, I found a problem:

Finally, administrator open CMD →netsh winsock reset → restart the computer and solve the problem.

source: http://hi.baidu.com/tzg18/item/dbf826f2fd683f733d198b1b

Connection for controluser as defined in your configuration failed.

Using the event scheduler (schedule tasks) in mysql,
The statement is written and runs fine, but it doesn’t have the desired result. The reasons for the failure of many planned tasks are summarized online. None of them fit me.
When you open the event table in phpmyAdmin, you see the following red prompt: Connection for Controluser as defined in your Configuration Failed.
“Due to the failure of the control user connection defined in the configuration.”
Without further ado, find phpyAdmin’s configuration file config.sample.inc. PHP, and see a paragraph like this:
/* PMA User advanced features */
$CFG [‘Servers’][$I][‘controluser’] = ‘PMA ‘;
$CFG [‘ the Servers’] [$I] [‘ controlpass] = $password;
It turns out that this user is the advanced user, when I installed the integration environment before, I didn’t let the user enter, I just needed to enter password,
As a result, I usually use a root account, but this account is not a power user, so I changed the pMA to root.
Back on the event table page, the red prompt disappears. My plan has started to work.
.
There are also people on the Internet who have summarized the reasons for the very common failure of event scheduling. Some important things to note are:
After the server is shut down and restarted, the planned task fails, which is not approved in the actual production.

Able to change mysql’s configuration file to resolve, add an event_scheduler=ON to my. Ini

Reproduced in: https://www.cnblogs.com/lcchuguo/p/5180282.html

php Error failed to open stream: HTTP request failed!

1. Change Php.ini to allow_url_fopen and change allow_url_fopen = On
2. But sometimes there is a warning, and you have to set the user_agent in PHp.ini. The default user_agent in PHP is PHP. MSIE 6.0; Windows NT 5.0) to simulate the browser
user_agent = “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)”

Job for apache2.service failed apache2 cannot be started

I planned to configure the virtual domain name in Apache before, so I did various operations on the configuration file of Apache. As a result, I don’t know why Apache always reported errors when it was restarted and started

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service"
 and "journalctl -xe" for details.

So I went to the apache2 error log /var/log/apache2 and couldn’t find a solution. So I unloaded Apache and reinstalled Apache and PHP

The next day, I encountered this problem again when I was tuning my configuration file. I used soft connection in both processes, so I wondered if there was something wrong with soft connection. I carefully checked what soft connection is

 Soft links under linux are similar to shortcuts under windows.

  Examples.
  ln -s httpd.conf confighttp

  where httpd.conf is the source file , conffighttp is the link filename , its role is to edit when conffighttp
, which is actually a link edit httpd.conf.
  If the soft link is to be removed.

  confighttp-rm-rf.

  This will only delete the conffighttp link file, but not the source file httpd.conf.

  As opposed to soft links, and hard links.
  Order to establish a hard link.
  ln httpd.conf confighttp

  A hard-linked file is the equivalent of a file stored in two locations, which effectively prevents accidental deletion.

Translated with www.DeepL.com/Translator (free version)

Then use the command to try to delete the previous soft connection, found success. Apache restore, problem resolved

An idea to solve Warning move_uploaded_file, failed to open stream in the process of php uploading files

Warning Move_uploaded_file failed to open stream
Problem description:
Do not know to have people with PHP upload files and encounter this kind of situation, when faced with this situation, I checked the Internet all kinds of information folder permissions are said not to, need to chmod 757, but not this command in the Windows, also have said need to change tmp_dir, but the answers are not change warning, so I carefully observed the tip mistakes, find a solution.

Solutions:
No such file or directory in… I can’t find the file or folder, so I go back to the directory where the project is located. There is no directory created after the move, so there is an error. So the way to fix it is to create a folder.
The core code is as follows:

move_uploaded_file($_FILES["file"]["tmp_name"], "./uploads/" . $_FILES["file"]["name"]);

Build LNMPR Error — php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

background
After installing Ubuntu subsystem in Win10 system, L(Linux)N(Nginx)M(mysql)P(PHP)R(Redis) environment was set up.
The error message
php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
The screening process

    check whether the services of nginx, php-fpm and redis-server are started normally; sudo /etc/init.d/nginx status check whether win10 can ping the ubuntu subsystem; Check if Redis configuration is correct; Check that Hosts is configured correctly;
is finally determined that DNS cannot be resolved normally, and DNS configuration

needs to be modified
The solution
Gateway configuration:
, 1 sudo vi/etc/resolvconf resolv. Conf., d/base

# 添加下面网关(223.5.5.5 和 223.6.6.6 是阿里的网关)

nameserver 223.5.5.5
nameserver 223.6.6.6

2, sudo resolvconf-u will synchronize the configured DNS to /etc/resolv.conf
3, check vi /etc/resolv.conf whether there is a newly configured DNS
4. Restart PHP sudo /etc/init.d/php-fpm restart

PHP message:filesize(): stat failed for Error

PHP Information: File Size(): Statistics Failure Errors

message:filesize(): stat failed for F:s2017\SinaImgUpload\SinaImgUpload\bin\Debug\TempPath\Cookies.txt

I checked that the path written by Phpstorm was correct, but I could not get the data
After careful examination, I found that \v had been escaped.

const SinaCookiesFile="F:\vs2017\SinaImgUpload\SinaImgUpload\bin\Debug\TempPath\Cookies.txt";

So I converted 
The problem was solved when \\v became \\v.

The reason for this problem is "" instead of using '' 
In php, variables ($var) and special characters (\r\n and such) in double quotes are escaped, content in single quotes is not escaped (so it's more efficient). 

So cut the language's future habits to accommodate single quotes and improve program efficiency.

php open(/var/lib/php/session/sess_4ofxxx, O_RDWR) failed: Permission denied (13)

Meet
session_start () :
open (/ var/opt/remi php72/lib/PHP/session/sess_4ofga8ehv8s2ct2b9dnn40qtp2, O_RDWR) failed: Permission denied (13)
Error message

session_start(): open(/var/opt/remi/php72/lib/php/session/sess_4ofga8ehv8s2ct2b9dnn40qtp2, O_RDWR) failed: Permission denied (13)

Solutions:

sudo chmod 1733 [报错的session的路径]

The solution for the above example is as follows

sudo chmod 1733 /var/opt/remi/php72/lib/php/session

Refer to the article

WordPress download template, update error No working transports found solution

    error because PHP did not open curl. Windows open method as follows

    1. Put php.ini; 2. Extension = remove the semicolon in front of php_curl. DLL
    Libeay32.ll, ssleay32.dll, php_curl, libssh2.dll move PHP into Windows /system32, and then restart Apache server, problem solved note: many answers on the net are put libeay32.ll, ssleay32.dll, php_curl. DLL three files are enough, but I try to come down, but also need libssh2.dll

ERROR: `phpize’ failed

The following errors occurred when installing the software:

Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: ` phpize ‘failed

Solutions:

yum install m4 autoconf

ERR_CONTENT_DECODING_FAILED error occurs in PHP program, summary of solutions

The problem background
When a new project is deployed to a new server, colleagues can run on Windows without any problems, but when migrating to a Liinux server, they find the following error.
chrome prompt: ERR_CONTENT_DECODING_FAILED
as follows:

Screening method
Check whether the nginx.conf of Nginx opens gzip; if it opens gzip, close it and reload to check whether the zlib.output_compression is open; if it is not opened, use zlib.output_compression = On
The solution
In the php.ini configuration file, the following configuration is found to be off. Open it and restart PHP-FPM

; http://php.net/zlib.output-compression
zlib.output_compression = On


Reference links:
https://stackoverflow.com/questions/14039804/error-330-neterr-content-decoding-failed