可以肯定的是,gd库没有安装成功. 1 拷贝php_gd2.dll到system32目录,去掉php.ini里面的;标记,重启服务器. 2 You don't have permission to access 这个错误可能是因为你修改了apache默认的documentRoot目录,但是没有改变下面的目录配置. 这两个是要对应的.
DocumentRoot "d:/web/root/" <Directory "d:/web/root/"># # This may also be "None", "All", or any combination of "Indexes", # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews". # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # Options Indexes FollowSymLinks# # This controls which options the .htaccess files in directories can # override. Can also be "All", or any combination of "Options", "FileInfo", # "AuthConfig", and "Limit" # AllowOverride All# # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory>
用phpinfo看看,应该有一行是:Configuration File (php.ini) Path /etc/php5/apache2 Loaded Configuration File /etc/php5/apache2/php.ini这个就是你的php.ini应该在的地方。同时,如果gd加载成功,你应该看到类似:gd GD Support enabled GD Version 2.0 or higher FreeType Support enabled这样的字样。我的是LAMP配置,和你的配置可能不一样。仅供参考。
把php.ini放在C:\WINDOWS(系统目录下)显示了下面的信息 gd GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.1.9 T1Lib Support enabled GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled 是说明php.ini放在C:\WINDOWS(系统目录下)是正确的吗?权限改成了如下: <Directory /> Options FollowSymLinks AllowOverride all Order deny,allow Allow from all </Directory> 但是还是显示 ForbiddenYou don't have permission to access /progphp/ch01/< on this server.
在网上找了好多配置权限的文章,都按照方法设置了,可是还是报错!ForbiddenYou don't have permission to access /progphp/ch01/ < on this server. 高人们帮帮忙吧,还有什么方法解决问题啊?急啊!
你用phpinfo()函数把gd相关的信息贴出来!
如果有 gd 方面的信息的话,你把 print_r( gd_info() ) 信息贴出来!
gdGD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.1.9 T1Lib Support enabled GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled
1. php.ini 文件应该放在C:\WINDOWS\system32目录下,还是C:\WINDOWS目录下? php.ini放在哪里并不重要,只要PATH环境变量设置php.ini所在目录了,就行。比如:如果你的PATH设置了E:\php这个目录的话,你也可以把php.ini放在这个目录。只是服务器会最后一个查找这个目录,会优先查找windows里的目录。确定到底加载的是哪个php.ini,需要看phpinfo()页面中Loaded Configuration File 这句话后边看到底是那个目录里的php.ini。 2. 报错信息Call to undefined function ImageCreateFromPNG() 和 You don't have permission to access 我已经在网上搜了好多文章,都没有解决,到底怎么设置啊? 首先要在php.ini里面 把extension=php_gd2.dll 前的分号要去掉 。 然后在php.int里面 extension_dir = "e:\php\ext" 设置你的php_gd2.dll所在的目录,比如你的是在e:\php\ext里边,则按照我上边的设置即可。如果是在别的目录,修改e:\php\ext为相应的目录即可。 最后重新启动apache服务器。 关键指处: 一、按照问题一的答案查看到底加载的是哪一个有效的php.ini 二、然后在按照问题二修改php.ini 三、重新启动apache
谢谢18楼的chongfenghao朋友,都按照你说的进行设置了!可是还有You don't have permission to access的报错信息!请指教!
通lz,我也遇到了相同的问题,phpinfo()显示信息如下: GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.1.9 T1Lib Support enabled GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled 但是在php文件中使用@imagecreatefromjpeg('1.jpg');函数就不能够成功 (1.jpg在当前目录下) 请求各位高手!
1 拷贝php_gd2.dll到system32目录,去掉php.ini里面的;标记,重启服务器.
2 You don't have permission to access
这个错误可能是因为你修改了apache默认的documentRoot目录,但是没有改变下面的目录配置.
这两个是要对应的.
DocumentRoot "d:/web/root/"
<Directory "d:/web/root/">#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride All#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
<Directory "d:/web/root/">
已经修改成一样的目录了!
还是不行!php.ini应该放在哪个目录啊?
你自己好好检查一下吧.注意修改完配置文件重启服务.
在php.ini文件是里面找到
;extension=php_gd2.dll把前面的;去丢。
然后apache重启服务器. 记住一定要重启..
Loaded Configuration File /etc/php5/apache2/php.ini这个就是你的php.ini应该在的地方。同时,如果gd加载成功,你应该看到类似:gd
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled这样的字样。我的是LAMP配置,和你的配置可能不一样。仅供参考。
2.php.ini放在C:\WINDOWS(系统目录下)
没有权限补充,把apache
<Directory />
Options FollowSymLinks
AllowOverride all
Order deny,allow
Allow from all
</Directory>
就ok
如果修改了php.ini还是没效果,就说明你改的php.ini并不是当前系统所加载的php.ini,需要运行phpinfo来查看Loaded Configuration File 后面的路径,改这个路径里面的php.ini才会生效。如果在linux下,gif和jpeg,png包都是需要单独下载并事先编译,然后编译gd库的时候再指定它们的位置。
gd
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled 是说明php.ini放在C:\WINDOWS(系统目录下)是正确的吗?权限改成了如下:
<Directory />
Options FollowSymLinks
AllowOverride all
Order deny,allow
Allow from all
</Directory>
但是还是显示
ForbiddenYou don't have permission to access /progphp/ch01/< on this server.
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
php.ini放在哪里并不重要,只要PATH环境变量设置php.ini所在目录了,就行。比如:如果你的PATH设置了E:\php这个目录的话,你也可以把php.ini放在这个目录。只是服务器会最后一个查找这个目录,会优先查找windows里的目录。确定到底加载的是哪个php.ini,需要看phpinfo()页面中Loaded Configuration File 这句话后边看到底是那个目录里的php.ini。
2. 报错信息Call to undefined function ImageCreateFromPNG() 和 You don't have permission to access 我已经在网上搜了好多文章,都没有解决,到底怎么设置啊?
首先要在php.ini里面
把extension=php_gd2.dll 前的分号要去掉 。
然后在php.int里面
extension_dir = "e:\php\ext"
设置你的php_gd2.dll所在的目录,比如你的是在e:\php\ext里边,则按照我上边的设置即可。如果是在别的目录,修改e:\php\ext为相应的目录即可。
最后重新启动apache服务器。
关键指处:
一、按照问题一的答案查看到底加载的是哪一个有效的php.ini
二、然后在按照问题二修改php.ini
三、重新启动apache
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
但是在php文件中使用@imagecreatefromjpeg('1.jpg');函数就不能够成功
(1.jpg在当前目录下)
请求各位高手!