English 中文(简体)
PHP 能够书写在公共文件夹中而不是在子夹中存档的形象
原标题:PHP Can write image to file in in public folder but not in subfolder

I m 试图用以下文字写成光盘:

imagejpeg($gdimage, dirname(__FILE__) . $path . $fileName);
  • If I set $path = /public/ the image is created.
  • 如果一套<条码>第1美元 = /public/images/ ,我就得到这一警告,不产生形象:

    警告:形象 Unable to open /Users/david/Documents/Developer/Netbeans Projects/aem.davidcasillas.es/public/images/498x282_v1_Golf-LaLlorea.jpg for written: /Users/david/Documents/Developer/Netbeans Project/aem.davidcasillas.es/ModuloGijon.php第943条

准许:

  • public folder: drwxr-xr-x 77 david admin 2618 24 abr 12:58 public
  • images folder: drwxr-xr-x 6 david admin 204 24 abr 10:38 images

So I see no reason why I canot create the image in the images folder. I have tried other subfolders in public and I always get the same error.

问题回答

修改分立体的许可,使之可以执行。

chmod -R 777 public

我找到了解决办法。 我正在与Netbeans合作,准备从我的文件夹到MAMP安装箱复印该项目。 我在MAMP安装过程中,而不是根据我的文件夹项目,创建ir子。 如果你检查警告路径,你就会看到它给我的文件夹,而不是复制/MAMP。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签