Articles of PHP

如何configurationNGINX位置服务器的子目录Codeigniter RESTful API?

我有以下目录结构: mysite.com – /api (codeigniter RESTful API Server) – /app (backbonejs app) 我试图configurationNGINX指向mysite.com/api*的所有请求到api目录并使用Codeigniter的设置。 我发现的一切工作正常,如果configuration文件在根目录。 但是,当你尝试把它放在一个子目录中时,就会失败。 这是我现在有: server { listen 80; server_name local.mysite.com; root /Users/me/Sites/mysite; autoindex on; index index.html index.php; location /api { try_files $uri $uri/ /api/index.php; location ~ \.php$ { root /Users/me/Sites/mysite/api; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } } 这样做只是给我一个“文件未find”的错误。 甚至没有一个适当的nginx 404.如何在服务器的subdir中为CodeIgniterconfigurationNGINX? […]

application / x-httpd-php和application / x-httpd-php-source之间的区别

这两种types的应用程序有什么区别? 我应该什么时候使用一个,而不是另一个? 它们只能在Apache中使用吗?

使用PHP PDO的CentOS上的MSSQL查询时间太长

我们使用PHP 7.1在CentOS Linux 7(Core)上运行MSSQL CTP 2.1; $dbh = new PDO ("dblib:version=7.0;charset=UTF-8;host=$mssql_pp_hostname:$mssql_pp_port;dbname=$mssql_pp_dbname","$mssql_pp_user","$mssql_pp_pass"); $stmt = $dbh->prepare(" query "); $stmt->execute(); 当运行一个简单的查询来select1项目。 它需要0.6〜0.9秒。 其中约0.2只用于连接。 select100个项目需要0.8。 但是,当连接形成一个外部客户端,似乎正在快速运行。 如用于Windows的Microsoft SQLpipe理器工具。 我们通过localhost与PHP连接。 所以我猜它必须做一些本地设置或者我们正在使用的驱动程序。 到底究竟是什么原因造成的?

错误404与WordPress子域使用nginx

我正在build立一个WordPress的子域的过程中。 我得到了一个404错误,我的nginxconfiguration。 目前使用PHP版本:7.0.22,没有得到任何错误的PHP日志,但我在nginx /var/log/nginx/error.log *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: xxx.xxx.xxx.xxx, server: kb.workspire.io, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7-fpm.sock", host: "kb.workspire.io" 这是我目前的服务器块 /etc/nginx/sites-available/kb.workspire.io server { listen 80 server_name kb.workspire.io; root /var/www/kb.workspire.io/wordpress; index index.php; location / { #try_files $uri $uri/ =404; try_files $uri $uri/ /index.php?q=$uri&$args; } listen 443 ssl; error_page 404 […]

Zabbix 3.4,Oracle Linux 7.4:php-mbstring和php-bcmath错误

我有操作系统 NAME="Oracle Linux Server" VERSION="7.4" ID="ol" VERSION_ID="7.4" PRETTY_NAME="Oracle Linux Server 7.4" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:oracle:linux:7:4:server" HOME_URL="https://linux.oracle.com/" BUG_REPORT_URL="https://bugzilla.oracle.com/" ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7" ORACLE_BUGZILLA_PRODUCT_VERSION=7.4 ORACLE_SUPPORT_PRODUCT="Oracle Linux" ORACLE_SUPPORT_PRODUCT_VERSION=7.4 试图安装zabbix 3.4 rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm 和 yum install zabbix-server-mysql zabbix-web-mysql 并返回错误 Error: Package: zabbix-web-3.4.1-1.el7.noarch (zabbix) Requires: php-mbstring Error: Package: zabbix-web-3.4.1-1.el7.noarch (zabbix) Requires: php-bcmath 如何解决问题? PS 试图安装 sudo yum install php-mbstring 回 Loaded plugins: […]

周期fopen()请求服务器php / apache饱和

我有以下的PHP脚本: if (fopen("http://google.com/", "r")) { return true; } return false; 这个脚本执行5秒钟。 它可能会带来PHP或Apache?

在Nginx中使用PHP7-FPM(Fallback)面对configuration错误HHVM

我想用PHP7-FPMconfigurationHHVM(作为后备)在Ubuntu 16.10我使用Nginx,但每当我尝试它继续给502错误所有的PHP文件! 我很确定configuration中有什么错误,但不知道如果你们可以帮助我,那真是太好了! 谢谢 这些configuration是(/ etc / nginx / sites-enabled) ## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # # Generally, you will want to move this file somewhere, and start with a […]

木偶在红帽子7上安装php-xsl模块

我需要在使用木偶pipe理的Red Hat 7.4服务器上安装php 5.6和一些php模块。 这是我的init.pp文件: package {"epel-release": provider=>rpm, ensure=>installed, install_options => ['–nodeps'], source=> "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm", } package {"ius-release": provider=>rpm, ensure=>installed, install_options => ['–nodeps'], source => "https://centos7.iuscommunity.org/ius-release.rpm", require => Package["epel-release"], } $php_packages = ['php56u', 'php56u-devel', 'php56u-intl', 'php56u-ldap', 'php56u-mysqli', 'php56u-xsl', 'php56u-gd', 'php56u-mbstring', 'php56u-mcrypt'] package { $php_packages: ensure => 'installed', } xsl和mysqli无法安装。 所有其他软件包安装正确。 这里是错误: Error: Execution of '/bin/yum -d […]

logging来自代理服务器的错误

我们有一个独特的代理设置,我们遇到了很多麻烦,试图排除故障。 问题的核心是服务器随机返回500/502/503错误,但我们的代理来自我们不能控制的服务器。 我们至less想知道代理是问题还是我们自己设置的问题。 不幸的是,这些错误都没有被捕获到我们的目的。 我们目前的设置如下: 在RackSpace上运行的LAMP堆栈,在负载平衡器后面有2个服务器,其URL为resource.example.com/thewebsite 然后外部公司使用他们自己的设置进行代理,并通过https://www.example.com/thewebsite的url将stream量传送到域名。 问题是没有提到的500个错误login我们的结尾。 我们的假设是,这是在用户发送到负载均衡器之前发生的,所以我们没有得到日志。 有什么方法可以find或捕获在负载平衡器上的错误吗? 控制代理的外部公司在这个问题上已经完全沉默,我们很难用一个好的方法来帮助解决问题。 谢谢!

无法增加Apache2中的最大POST大小

我试图增加POST请求的大小,以便让用户上传“大”文件后,上传小(约2 Mb)的“413请求实体太大”的错误。 我的Apache2在Ubuntu 16.04上启用了mod_security2,所以我编辑了位于/etc/modsecurity/modsecurity.conf的configuration文件,添加: SecRequestBodyLimit 13107200 SecRequestBodyNoFilesLimit 13107200 即使我重启了Apache2,这个改变似乎被忽略了,因为我继续看到在POST中发送的2M字节的testing文件中有413个错误。 所以我打开了Apache2configuration文件/etc/apache2/sites-enabled/000-default.conf并用下面的代码编辑它: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined LimitRequestFieldSize 10000000 # <——- LimitRequestBody 10000000 # <——- </VirtualHost> 再说一遍,重启后没有运气。 最后更改是编辑php.ini,所以我添加了这个: post_max_filesize="10M" upload_max_filesize="10M" post_max_size="10M" 你猜怎么了? 我在尝试2M字节的文件时仍然有413个错误。 我真的不能看到另一种方式来实现,也许是有一些其他的configuration文件改变?