簡體   English   中英

使用IP地址而不是本地主機時,上傳文件不起作用

[英]Upload file not working when using ip address instead of localhost

當我嘗試使用本地主機在項目中上載圖像時,它可以工作,但是當我嘗試使用IP地址而不起作用時,則無法工作。 例如,我嘗試了以下方法:

 localhost/my-project/upload 

哪個有效。 然而,

 192.192.52.2/my-project/upload 

不起作用。

這個問題有解決方案嗎?

因此,誰能告訴我在PHP中使用IP地址而不是localhost時應該出什么問題。

Try this. First go to your folder.
Example: (C:)xampp/htdocs/yourfoldername/application/config/config.php

Open config.php. And add this


/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
| If this is not set then CodeIgniter will guess the protocol, domain and
| path to your installation.
|
*/

 $config['base_url'] = 'http://192.192.52.2/yourfoldername/'; 

or

 $config['base_url'] = 'http://192.192.52.2/my-project/upload/'; 

/*

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM