Php Can';t从某些计算机上传文件到家庭服务器

Php Can';t从某些计算机上传文件到家庭服务器,php,file-upload,apache2,Php,File Upload,Apache2,最近我在家里安装了带有Ubuntu操作系统和XAMPP的小型服务器。现在我有了一个简单的基于PHP的界面,可以将PDF文件上传到服务器,并运行shell脚本从中提取页面。它在我的本地网络(通过本地IP访问)、家庭互联网(通过外部IP访问)甚至通过android手机(通过外部IP)从移动互联网都能完美地工作。但无论是从我的工作网络,还是从我妻子的工作网络(最重要的),它都不起作用 问题是无法上载文件。网页只是无限地“思考”,没有错误报告,我甚至不知道该去哪里挖掘,该怪谁。脚本的其余部分可以很好地处

最近我在家里安装了带有Ubuntu操作系统和XAMPP的小型服务器。现在我有了一个简单的基于PHP的界面,可以将PDF文件上传到服务器,并运行shell脚本从中提取页面。它在我的本地网络(通过本地IP访问)、家庭互联网(通过外部IP访问)甚至通过android手机(通过外部IP)从移动互联网都能完美地工作。但无论是从我的工作网络,还是从我妻子的工作网络(最重要的),它都不起作用

问题是无法上载文件。网页只是无限地“思考”,没有错误报告,我甚至不知道该去哪里挖掘,该怪谁。脚本的其余部分可以很好地处理已上载的PDF文件

请帮忙,至少我该从哪里开始找

以下是PHP脚本的一部分(不确定是否有用):

php.ini中的文件上载部分:

file_uploads=On
upload_tmp_dir="/opt/lampp/temp/"
upload_max_filesize=128M
temp
文件夹的权限为777

HTML表单数据:

<form action="procc.php" method="post" enctype="multipart/form-data">
<div>Choose uploaded file or upload a new one:</div>
<div style="width: 400px; height: 200px; border: 1px solid black; overflow-y: scroll;">
<table width="100%">
<tr><td><div><label><input onchange="chfile(this.value)" type="radio" name="file" value="1.Вентиляторы.pdf" />1.Вентиляторы.pdf</label></div></td><td><a target="_blank" href="pdfs/1.Вентиляторы.pdf">[open]</a></td></tr>
</table>
</div>
<div>Upload new PDF file: <span style="border: 1px solid black;"><input type="file" name="upl" accept="application/pdf" /></span><br />
(If both [new file to upload] and [file from list] is set, then file from list will be ignored)
</div>
<hr width="400" align="left" />
<div>Chosen file (from list): <span id="chosen"></span></div>
<div>First and last page: <input type="text" size="4" name="fp" /> - <input type="text" size="4" name="lp" /></div>
<div>New filename: <input type="text" size="10" name="nname" /></div>
<div>(last field can be ignored, in this case name will be based on the original filename)</div>
<div><button name="act" value="ext">Extract pages</button></div>
</form>
我已经打开了服务器上的所有端口(1-65535),现在它可以在我的工作场所网络上正常工作,但我并不喜欢这个解决方案。有人能给我一个关于哪些端口保持开放的建议吗?
在此之前,我打开了四个端口:用于HTTP、SSH和两个用于FTP。

也许您的工作场所存在防火墙限制,阻止像这样的上载?可能是不同的事情,例如,服务器配置、pdf文件太大等等。尝试上载一个小图像只是为了调试原因。您的代码并不完全安全。您至少检查了.pdf扩展名,但您盲目地使用了用户提供的
['name']
参数,允许恶意用户在您的服务器上任意涂鸦pdf文件。@DarrenCrabb,同样的pdf文件可以很容易地上传到其他公共服务器(例如电子邮件服务器)好吧,那就破坏了这个理论。。。可能值得检查php.ini文件中的所有值,以确保其中没有任何内容阻止访问或限制文件大小等。我知道默认情况下,其中有2Mb的上载限制。
<form action="procc.php" method="post" enctype="multipart/form-data">
<div>Choose uploaded file or upload a new one:</div>
<div style="width: 400px; height: 200px; border: 1px solid black; overflow-y: scroll;">
<table width="100%">
<tr><td><div><label><input onchange="chfile(this.value)" type="radio" name="file" value="1.Вентиляторы.pdf" />1.Вентиляторы.pdf</label></div></td><td><a target="_blank" href="pdfs/1.Вентиляторы.pdf">[open]</a></td></tr>
</table>
</div>
<div>Upload new PDF file: <span style="border: 1px solid black;"><input type="file" name="upl" accept="application/pdf" /></span><br />
(If both [new file to upload] and [file from list] is set, then file from list will be ignored)
</div>
<hr width="400" align="left" />
<div>Chosen file (from list): <span id="chosen"></span></div>
<div>First and last page: <input type="text" size="4" name="fp" /> - <input type="text" size="4" name="lp" /></div>
<div>New filename: <input type="text" size="10" name="nname" /></div>
<div>(last field can be ignored, in this case name will be based on the original filename)</div>
<div><button name="act" value="ext">Extract pages</button></div>
</form>
[Wed Oct 23 20:03:31.064659 2013] [mpm_prefork:notice] [pid 2339] AH00169: caught SIGTERM, shutting down
[Wed Oct 23 20:03:38.243555 2013] [ssl:warn] [pid 2857] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Oct 23 20:03:38.243843 2013] [ssl:warn] [pid 2857] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Oct 23 20:03:38.243957 2013] [suexec:notice] [pid 2857] AH01232: suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
[Wed Oct 23 20:03:38.625858 2013] [auth_digest:notice] [pid 2858] AH01757: generating secret for digest authentication ...
[Wed Oct 23 20:03:39.123570 2013] [ssl:warn] [pid 2858] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Oct 23 20:03:39.123708 2013] [ssl:warn] [pid 2858] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Oct 23 20:03:39.123844 2013] [lbmethod_heartbeat:notice] [pid 2858] AH02282: No slotmem from mod_heartmonitor
[Wed Oct 23 20:03:39.157999 2013] [mpm_prefork:notice] [pid 2858] AH00163: Apache/2.4.4 (Unix) OpenSSL/1.0.1e PHP/5.5.3 mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations
[Wed Oct 23 20:03:39.158180 2013] [core:notice] [pid 2858] AH00094: Command line: '/opt/lampp/bin/httpd -E /opt/lampp/logs/error_log -D SSL -D PHP'