Articles of PHP5

如何将文件夹的内容redirect到其他域?

我们已经把我们的网站迁移到WordPress,但是我们依靠几个文件夹,而且我们已经有了指向旧地点的链接和图片。 例如: http://domain.com/t/image_001.png 但我不想再将所有图像添加到新的网站位置,我宁愿设置一个子域,并保持在同一个地方 我如何redirect http://domain.com/t/*.*到http://t.domain.com/*.* ? 我需要在php.ini文件中做的事情? 或者这是一个网站configuration?

在CentOS 6上用GD安装PHP 5.2

我正试图在CentOS 6.2上安装PHP 5.2.17。 我已经从http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMs/下载了RPM 问题在于,PHP RPM似乎默认禁用了GD。 因此尽pipe安装了php-gd RPM,但是GD被禁用了。 有什么办法可以启用GD。 Atomicorp似乎是PHP 5.2.17 RPM的唯一网站。 我不是能够编译PHP的高级用户。 我会很感激这方面的帮助。

如何减less每个虚拟服务器的内存使用量

在CentOS 5.8 / Apache 2.2.3 / FastCGI / PHP 5.3.10虚拟机上我有原始和克隆的Magento安装(用作登台服务器)。 我想通过这个暂存服务器上的apache和php最小化内存使用情况,我正在寻找如何做到这一点的build议 。 例如,我想知道是否可以在单个虚拟服务器上设置像prefork MPM / worker MPM这样的限制。 PHP的memory_limit已经设置为128M,因为这是最低的Magento需要运行。 谢谢

使用NGiNX在Ubuntu上安装PHP-FPM(PHP 5.4)

这是CMD: pecl install apc 结果: downloading APC-3.1.9.tgz … Starting to download APC-3.1.9.tgz (155,540 bytes) ……………………………done: 155,540 bytes 54 source files, building running: phpize Configuring for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525 Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this […]

我在哪里可以得到Windows的php5apache2_4.dll?

我有一个新的笔记本电脑与Windows 7,并希望build立一个PHP + MySQL的开发环境。 于是,我下载了httpd_2.4.3-netware-bin并成功安装了Apache 2.4 。 然后我得到php-5.4.10-nts-Win32-VC9-x86.zip并解压缩。 但是我找不到php5apache2_4.dll 。 (我需要把它放在httpd.conf ,对吗?) 所以我去了谷歌,但我什么都没有。 我在哪里可以得到它?

修改/ var / www / project的权限

我正在用Ubuntu Linux,MySQL和PHP开发Web应用程序。 我把我的文件放在/var/www/some_web_project/目录下。 我有权限问题,例如,当我想通过<img src="images/some.jpg"/>在我的web应用程序中输出图像时,直到更改文件夹的权限才显示图像。 通常我把它改成777 。 但我不认为这是从安全的angular度来看是正确的 什么应该是正确的权限模式?

嘻哈汇编90%失败

我一直在使用gcc-4.6.2在新鲜的centos-6.3上使用hiphop,并按照下面的指南来编译hiphop https://github.com/facebook/hiphop-php/wiki/Building-and-installing-HHVM- on-CentOS-6.3 。 然而编译失败了90%,并产生错误,其中几个给出如下,有人可以帮助我吗? [ 1%] Built target timelib [ 2%] Built target xhp [ 10%] Built target mbfl [ 11%] Built target afdt [ 14%] Built target folly [ 15%] Built target double-conversion [ 15%] Built target sqlite3 [ 15%] Built target lz4 [ 67%] Built target hphp_runtime_static [ 77%] Built target hphp_analysis […]

我无法在我的Ubuntu服务器上安装php5-apc

我无法安装php5-apc。 我似乎没有得到任何错误。 root@applications-server-1:~# aptitude install php5-apc The following NEW packages will be installed: php5-apc{b} 0 packages upgraded, 1 newly installed, 0 to remove and 57 not upgraded. Need to get 64.6 kB of archives. After unpacking 168 kB will be used. The following packages have unmet dependencies: php5-apc : Depends: php5-common (= 5.3.22-1~dotdeb.0) but 5.4.6-1ubuntu1.1 […]

我如何更改xml2-config的path

我已经在stackoverflow中提出了相同的问题,我需要更多的帮助。 我试图在CentOS5.5 libxml2从2.6.26升级到2.7.7 我在/opt/libxml2-2.7.7/bin/安装了libxml2-2.7.7 我已经通过yum install libxml2 libxml2-devel在/usr安装了2.6.26 。 当我configurationPHP5.3 –with-libxml-dir=/opt/libxml2-2.7.7/bin消息显示。 checking whether to enable LIBXML support… yes checking libxml2 install dir… /opt/libxml2-2.7.7/bin checking for xml2-config path… /usr/bin/xml2-config PHP的configuration在/opt/libxml2-2.7.7/bin找不到xml2-config文件 我不希望PHPconfiguration看起来/usr/bin/xml2-config以便安装的PHP使用libxml2-2.6.26 。 所以,我现在有两个不同版本的libxml2 #/opt/libxml2-2.7.7/bin/xml2-config –version 2.7.7 # /usr/bin/xml2-config –version 2.6.26 这是PATH环境variables。 PATH=/opt/php-5.3.14/bin:/opt/apache-httpd-2.2.22/bin:/opt/libxml2-2.7.7/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/lib/oracle/11.2/client64/bin 我认为/opt/libxml2-2.7.7/bin在/usr/bin 。 但是如果我inputxml2-conifg没有path,那么它就是/usr/bin下的一个。 # xml2-config –version 2.6.26 有没有其他的设置使xml2-config在/opt/libxml2-2.7.7/bin下/opt/libxml2-2.7.7/bin ? 我也改变了符号链接。 ls -la|grep libxml -rw-r–r– […]

suphp错误目录/不属于pipe理员

我试图运行一个testingphpinfo页面: /home/admin/testdomain.com 但它显示这样的错误: Internal Server Error Directory / is not owned by admin suPHP 0.7.1 我的/etc/suphp.conf是这样的: [global] logfile=/var/log/httpd/suphp_log loglevel=info webserver_user=apache docroot=/ env_path=/bin:/usr/bin umask=0022 min_uid=500 min_gid=48 ; Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false ;Check wheter script is within DOCUMENT_ROOT check_vhost_docroot=false ;Send minor error messages to browser errors_to_browser=true [handlers] ;Handler for php-scripts x-httpd-php="php:/usr/bin/php-cgi" ; x-httpd-php52="php:/usr/local/lxlabs/ext/php/bin/php_cgi" x-httpd-php52="php:/usr/local/lxlabs/ext/php/etc/lxphpcgi.sh" ;Handler […]