dqc18251 2017-08-31 15:59
浏览 37

PHP文件未在WAMP localhost中加载[重复]

This question already has an answer here:

I am new to php and utilizing WAMP platform (version 3.0.6). I have two php files, one is a database connection script to the MySQL databse I created, the other is an html web form with embedded php scripts. Both were created in Microsoft Notepad as my editor and saved with the extension (.php) in the Windows(C:) >wamp64 >www >demoproject folder. While browsing in Windows explorer I noticed the file type is saved as "Text Document", even though the extensions were both saved with .php.

When I launch localhost in my browser and select the project folder listed under Your Projects I receive an error "This site can't be reached". Not sure why this is happening. I am able to open the root directory if I navigate to localhost/demoproject , which from there I can see the two php files (saved as Newspaper2.html.txt and connect-mysql.php.txt). When I launch the newspaper file (html form with php) all I receive is the scripting I created, as opposed to opening the web form. I checked the port for the localhost and I am running on port 80, and I've tried playing with the file extensions a little but it hasn't helped. Apologies if this has been asked before, I didn't see anything specific to this issue. I appreciate any assistance! Thanks.

</div>
  • 写回答

1条回答 默认 最新

  • douchenchepan6465 2017-08-31 16:01
    关注

    Files that don't end in .php will not be interpreted unless you have configured their extension to be interpreted in your php.ini.

    Basically: remove the .txt from the end.

    评论

报告相同问题?

悬赏问题

  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊