'http://cp.a.com/'"; then open the "base.php" file And modify the code to "define(...)"."/> 'http://cp.a.com/'"; then open the "base.php" file And modify the code to "define(...)".">

Home  >  Article  >  CMS Tutorial  >  What should I do if phpcms v9 cannot upload pictures?

What should I do if phpcms v9 cannot upload pictures?

藏色散人
藏色散人Original
2020-01-14 09:38:312463browse

What should I do if phpcms v9 cannot upload pictures?

What should I do if phpcms v9 cannot upload images?

Solution to the problem that PHPCMS V9 cannot upload pictures

The PHPCMS V9 editor cannot upload pictures. When I checked, it used a second-level domain name. This may be the reason why pictures cannot be uploaded. Let’s analyze the reason below.

Management address. In the background-"Settings-"Related Settings-"Security Settings, fill in a second-level domain name as the management address and modify it. 'admin_url' under caches/configs/system.php => 'admin.main domain name.com', //Domain name allowed to access the backend

After careful analysis, the BUG was found, and the management backend was first set up according to the official After the dedicated second-level domain name is used, when other domain names access the backend management, a prompt that there is no access permission will appear. Will the editor address called when uploading images still use the 'app_path' in system.php => 'http ://www.main domain name.com/', as for the generated address, when uploading pictures, the page will get stuck without permission when uploading. This is confirmed by a netizen's blog on the website. The bug occurs when the administrator sets a dedicated management domain name, but the editor used in the background is still using the editor called by the main domain name, so there is no permission to upload attachments and pictures.

Solution

Method 1

Do not use a dedicated second-level domain name management background and release permissions. Everything is ok

Method 2

The problem is that a dedicated second-level domain name must be used to manage the backend.

1. Modify system.php and add a line below 'app_path' => 'http://www.primary domain name.com/'

'up_path' => 'http: //cp.a.com/',//Backend domain name configuration address

2. Modify /phpcms/base.php and add the following code

The code is as follows:

//后台CKEditor地址
define('UP_PATH',pc_base::load_config('system','up_path'));  

3. Modify /phpcms/libs/classes/form.class.php

and change

[code]
if($allowupload) $str .= "filebrowserUploadUrl : '".APP_PATH."index.php?m=attachment&c=attachments&a=upload&module=".$module."&catid=".$catid."&dosubmit=1',rn";

to

[code]
if($allowupload) $str .= "filebrowserUploadUrl : '".UP_PATH."index.php?m=attachment&c=attachments&a=upload&module=".$module."&catid=".$catid."&dosubmit=1',rn";

Installing PHPCMS V9 (Destoon, etc.) cannot be done in the DeDeAMPZ environment How to upload pictures

I planned to make a website using Destoon, but I found that no matter what, I couldn’t upload pictures in the background, and the same was true for thumbnails, but I could do network address pictures.

Later I searched for information online and found that many people had this problem.

Finally, I found a solution in an article, but it was too messy, so I fumbled around and solved it successfully.

The code is as follows:

upload_tmp_dir = "D:/DedeAMPZ/tmp/uploads"
session.save_path = "D:/DedeAMPZ/tmp/sessions"

I set these two folders to the root directory of my website, and set user permissions to be writable.

The code is as follows:

upload_tmp_dir = "D:/DedeAMPZ/WebRoot/xxx.com/tmp/uploads"
session.save_path = "D:/DedeAMPZ/WebRoot/xxx.com/tmp/sessions"

After the setting is completed, be sure to restart Apache or iis.

PHP Chinese website, a large number of free PHPCMS tutorials, welcome to learn online!

The above is the detailed content of What should I do if phpcms v9 cannot upload pictures?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn