简体   繁体   English

Xampp不显示回显文本

[英]Xampp not showing echo text

Xampp seems to be running fine, status says php is running, I am able to access the localhost xampp status website and do phpinfo there and it look good. Xampp似乎运行良好,状态表示php正在运行,我能够访问localhost xampp status网站,并在那里进行phpinfo,它看起来不错。

It also work to run a php script that change a websites background image. 运行更改网站背景图像的php脚本也可以。

but its not possible to echo some strings... 但是无法回显一些字符串...

<?php echo '<p>Hello World</p>'; ?> 

returns: Hello World '; 返回:Hello World'; ?> ?>

<?php
    $name='Harry';
    echo $name;
?>

returns nothing, all blank. 不返回任何内容,全部为空白。

<?php phpinfo(); ?>

returns nothing, all blank. 不返回任何内容,全部为空白。

<?php print(Date("l F d, Y")); ?>

returns nothing, all blank. 不返回任何内容,全部为空白。

I am accessing the file like this: 我正在像这样访问文件:

http://localhost/dummies/helloW.php

source code: 源代码:

<!DOCTYPE html>
<head>
    <title>PHP test</title>
</head>
<body>

<?php echo '<p>Hello World</p>'; ?> 

<?php
    $name='Harry';
    echo $name;
?>


<?php phpinfo(); ?>

<?php print(Date("l F d, Y")); ?>

</body>
</html>

What could cause this problem ? 什么会导致此问题?

ACCESS_log ACCESS_log

127.0.0.1 - - [22/Sep/2014:14:54:56 +0200] "GET /xampp/perl.pl HTTP/1.0" 200 2 127.0.0.1 - - [22/Sep/2014:14:54:56 +0200] "GET /xampp/status.php HTTP/1.1" 200 3891 127.0.0.1 - - [22/Sep/2014:14:58:04 +0200] "GET /dummies/helloW.php HTTP/1.1" 200 474 127.0.0.1 - - [22/Sep/2014:14:58:06 +0200] "GET /dummies/helloW.php HTTP/1.1" 200 474 127.0.0.1 - - [22/Sep/2014:14:58:07 +0200] "GET /dummies/helloW.php HTTP/1.1" 200 474 127.0.0.1--[22 / Sep / 2014:14:54:56 +0200]“ GET /xampp/perl.pl HTTP / 1.0” 200 2 127.0.0.1--[22 / Sep / 2014:14:54: 56 +0200]“ GET /xampp/status.php HTTP / 1.1” 200 3891 127.0.0.1--[22 / Sep / 2014:14:58:04 +0200]“ GET /dummies/helloW.php HTTP / 1.1” 200 474 127.0.0.1--[22 / Sep / 2014:14:58:06 +0200]“ GET /dummies/helloW.php HTTP / 1.1” 200 474 127.0.0.1--[22 / Sep / 2014:14: 58:07 +0200]“ GET /dummies/helloW.php HTTP / 1.1” 200 474

ERROR_log ERROR_log

[Mon Sep 22 14:57:03.001150 2014] [ssl:warn] [pid 23774] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?) [Mon Sep 22 14:57:03.001194 2014] [ssl:warn] [pid 23774] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Mon Sep 22 14:57:03.001349 2014] [lbmethod_heartbeat:notice] [pid 23774] AH02282: No slotmem from mod_heartmonitor [Mon Sep 22 14:57:03.009740 2014] [mpm_prefork:notice] [pid 23774] AH00163: Apache/2.4.10 (Unix) OpenSSL/1.0.1i PHP/5.5.15 mod_perl/2.0.8-dev Perl/v5.16.3 configured -- resuming normal operations [Mon Sep 22 14:57:03.009786 2014] [core:notice] [pid 23774] AH00094: Command line: '/opt/lampp/bin/httpd -E /opt/lampp/logs/error_log -D SSL -D PHP' [Mon Sep 22 14:58:22.036884 2014] [mpm_prefork:notice] [pid 23774] AH00169: caught SIGTERM, shutting down [2014年9月22日星期一14:57:03.001150] [ssl:warn] [pid 23774] AH01906:www.example.com:443:0服务器证书是CA证书(BasicConstraints:CA == TRUE !?)[9月星期一22 14:57:03.001194 2014] [ssl:warn] [pid 23774] AH01909:www.example.com:443:0服务器证书不包含与服务器名称匹配的ID [2014年9月22日星期一14:57:03.001349 ] [lbmethod_heartbeat:notice] [pid 23774] AH02282:没有来自mod_heartmonitor的slotmem [2014年9月22日星期一14:57:03.009740] [mpm_prefork:notice] [pid 23774] AH00163:Apache / 2.4.10(Unix)OpenSSL / 1.0。 1i PHP / 5.5.15 mod_perl / 2.0.8-dev Perl / v5.16.3已配置-恢复正常操作[2014年9月22日星期一14:57:03.009786] [core:notice] [pid 23774] AH00094:命令行:' / opt / lampp / bin / httpd -E / opt / lampp / logs / error_log -D SSL -D PHP'[Mon Sep 22 14:58:22.036884 2014] [mpm_prefork:notice] [pid 23774] AH00169:捕获了SIGTERM,关机

PHP_ERROR_log PHP_ERROR_log

contains nothing.... 不包含任何内容。

Your PHP isn't running. 您的PHP未运行。 Output of 输出

<?php echo '<p>Hello World</p>'; ?> 

In an HTML file? 在HTML文件中?

Hello World'; ?>

Linux? Linux的? Not my cup of tea. 不是我喜欢的。 Find out if Apache is running. 找出Apache是​​否正在运行。 If it is, Just uninstall and re-install Xampp. 如果是这样,只需卸载并重新安装Xampp。 It's just Xampp. 就是Xampp。 Unless you're using it in a live environment. 除非您在现场环境中使用它。 In which case, hand in your PHP badge, you're off the force. 在这种情况下,只需交上PHP徽章,您就可以放心使用。

PS You missed a semicolon after 'Harry' PS您在'Harry'之后错过了分号

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM