php.ini设置Max Input Vars和WordPress allowed memory size

Increasing Max Input Vars

Increasing Max Input Vars in .htaccess File

It’s possible to increase it from .htaccess file in root WordPress installation’s directory. For this you need connect to your server via FTP (using some FTP client like FileZilla), find .htaccess file in the root of your site directory (or create it yourself if it’s missing) and add below lines of codes at the end of the .htaccess file:

php_value max_input_vars 3000
php_value suhosin.get.max_vars 3000
php_value suhosin.post.max_vars 3000
php_value suhosin.request.max_vars 3000

Increasing Max Input Vars in php.ini File

For this scenario you should also connect via FTP or log in to the CPanel of your hosting provider.

At the end of the php.ini file, add below lines of codes. The php.ini file can be found in /user/local/bin/, /etc/php5/ or … depending on the host provider. If you can not find it, it’s better contact your hosting provider. On some hosting providers, you can create a php.ini file in the root directory and just add the following codes to override the default values.

max_input_vars = 3000
suhosin.get.max_vars = 3000
suhosin.post.max_vars = 3000
suhosin.request.max_vars = 3000

Increase the WordPress allowed memory size

To increase the WordPress allowed memory size for your website:

  1. Open wp-config.php, which by default is located in the root WordPress directory.
  2. Find the following line near the end of the file:
  3. /* That’s all, stop editing! Happy blogging. */
  4. Just above that line, add the following line:
  5. define(‘WP_MEMORY_LIMIT’, ’96M’);

Save your changes.

You can also increase memory to a higher number, and you can also increase the memory limit for admin tasks, as described in the WordPress codex.

If you’re still receiving the error after this fix, contact your web host provider or server administrator for their help.

Windows服务器通过xampp发送邮件

Xampp是一个集成的开发环境,主要的目的是为开发者提供本地开发环境。

在开发的过程当中,开发者基本上都需要利用xampp来接受邮件,需要能随时与网站的客户进行对话来避免不必要的生意的错失。

设置从xampp发送邮件,需要在xampp安装好之后进行配置。按照以下几个步骤就可以完成。

利用Xampp发送邮件

  1. 打开Xampp的安装目录。
  2. 定位到C:\xampp\php然后打开php.ini文件。
  3. 按住ctrl + f 搜索 [mail function]。
  4. 找到下面几个并进行替换。腾讯云和阿里云的服务器的邮件端口是465,因为服务器封了传统的25端口,由于一开始垃圾邮件泛滥的原因。

SMTP=smtp.qq.com
smtp_port=465
sendmail_from = yourname@qq.com
sendmail_path = “\”C:\xampp\sendmail\sendmail.exe\” -t”

接下来,定位到C:\xampp\sendmail文件夹,打开sendmail.ini进行配置。

  1. 按住ctrl + f 找到[sendmail]。
  2. 找到并替换掉下面内容:

smtp_server=smtp.qq.com
smtp_port=465
error_logfile=error.log
debug_logfile=debug.log
auth_username=YourGmailId@qq.com
auth_password=Your-Password(注意,这里是QQ邮箱的授权码,在QQ邮箱网页版,账户设置里,找到imap那里,点击生成授权码)
force_sender=YourGmailId@qq.com(optional)

测试邮件发送的简单的脚本:

<?php
$to_email = “receipient@gmail.com”;
$subject = “Simple Email Test via PHP”;
$body = “Hi,nn This is test email send by PHP Script”;
$headers = “From: sender\’s email”;

if (mail($to_email, $subject, $body, $headers)) {
    echo “Email successfully sent to $to_email…”;
} else {
    echo “Email sending failed…”;
}

如果你仍然还遇到邮件发送的问题,可能是以下几个原因:

  1. 邮件发送的比较慢,遇到网络拥堵。
  2. 邮件配置的不正确。
  3. 发送邮件的服务器端口被屏蔽了。
  4. 邮箱设置的授权码不正确,你设置成邮箱密码了。

Xampp使用教程

xampp使用教程 安装xampp后, 修改httpd:conf文件里面的, DocumentRoot “D:/wwwroot”<Directory “D:/wwwroot”>

修改为你自己的存在网页的文件夹里。

然后修改, conf/extra/httpd-vhosts.conf文件,

添加如下代码,使你解析的域名对应到相应文件夹:<VirtualHost *:80>     DocumentRoot “D:/wwwroot/weblinks.cc”  ServerName weblinks.cc  ServerAlias www.weblinks.cc  </VirtualHost>然后修改phpmyadmin远程登陆及设置密码。

打开apache / conf / extra / httpd-xampp.conf

找到:Alias/phpmyadmin”E:/Program Files/phpMyAdmin/”;

将<Directory “E:/Program Files/phpMyAdmin”> 里面的内容,修改为:AllowOverride AuthConfig    #Require local   Order allow,deny   Allow from all   Require all granted

由于xampp访问phpmyadmin默认是不需要密码的,所以我们访问的时候会直接进入到phpmyadmin操作界面;

点击phpmyadmin的管理页面,找到 账户,

找到root,隶属localhost的账户,点击修改权限,然后点击修改密码,创建你的密码。

然后我们需要进入XAMPP安装目录下的phpmyadmin目录,找到config.inc.php文件,

找到authentication type and info,

将auth_type改为cookie,