Php 长url给出了一个404错误

Php 长url给出了一个404错误,php,apache,Php,Apache,我想用GET方法将base64图像转换为jpeg文件。但是服务器给出了一个404错误 我的代码: <?php $qrdata= htmlspecialchars($_GET['c'] , ENT_QUOTES); //Format the data and write the QR data to a local file $qrdata= str_replace(" ", "+", $qrdata); $file = "qr.data"; file_put_contents($fil

我想用GET方法将base64图像转换为jpeg文件。但是服务器给出了一个404错误

我的代码:

<?php

$qrdata= htmlspecialchars($_GET['c'] , ENT_QUOTES);

//Format the data and write the QR data to a local file
$qrdata= str_replace(" ", "+", $qrdata);
$file = "qr.data";
file_put_contents($file, $qrdata);

//Function to convert the base64 to image file
function base64_to_jpeg($base64_string, $output_file) {
    $ifp = fopen($output_file, "wb"); 
    $data = explode(',', $base64_string);
    fwrite($ifp, base64_decode($data[1])); 
    fclose($ifp); 
    return $output_file; 
}

//Call to the function
$image = base64_to_jpeg( $qrdata, 'tmp.jpg' );
?>
服务器响应:

404 - File or directory not found.

这段代码在localhost中工作。

为什么域名中有空格?无论如何,您能否确认
convert.php
文件存在,并且就在web服务器的文档根目录下?是的httpdocs/convert.php。我尝试了短url,然后页面被打开了,但长url给我404错误你在用哪个浏览器测试这可能有用除了浏览器之外,还有各种各样的东西可以限制查询字符串的实际长度
404 - File or directory not found.