I use 000webhost's free hosting service.
I have a dynamic CSS stylesheet by making it PHP and making it choose between one of a few (currently three) stylesheets and using that.
It works perfectly fine on my Apache server but not on my 000Webhost site.
And check the resources/network tabs, and you should see it trying to load your script but not finding it. (My guess anyway, as generally public_html is not part of the URL.)
发布评论
评论(2)
php 文件的路径必须可由浏览器访问。
即如果您的网站是 http://domainname.com
样式表应链接到 http://domainname.com/stylesheet.php
尝试使用 Chrome 开发者工具,
Safari 开发者工具,
Firefox - firebug
检查资源/网络选项卡,您应该看到它尝试加载您的脚本但没有找到它。 (无论如何我的猜测,因为通常 public_html 不是 URL 的一部分。)
The path to the php file has to be accessible by the browser.
i.e. if your website is http://domainname.com
The stylesheet should link to http://domainname.com/stylesheet.php
Try using Chrome developer tools,
Safari developer tools,
Firefox - firebug
And check the resources/network tabs, and you should see it trying to load your script but not finding it. (My guess anyway, as generally public_html is not part of the URL.)
进入您的个人资料,进入常规设置并向下滚动
并将 PHP 版本 7 更改为 版本 5 。
go into your profile in profile go into genral setting and scroll down
and chnge PHP virsion 7 to version 5 .