我买了一个空间,然后把网站在空间里发布了,用的是apache+mysql。现在的问题是,我用127.0.0.1和localhost都能访问,但是外网就访问不了(直接用IP访问的)。
我设置了httpd里面的allow from all,把 deny from all也删掉了的,listen也设置了的,防火墙也关了的,但是还是访问不了!
网页直接打不开,也没有“Forbidden You don't have permission to access / on this server.”的提示。。
但是用其他电脑ping空间的IP又能通~~
现在不知道是哪里出了问题了,求助大神~~
回复讨论(解决方案)
请给出域名!
请给出域名!
域名还在备案,我直接用IP访问的。 IP是:121.12.175.19.
很慢,?法?接
Google Chrome could not load the webpage because 121.12.175.19 took too long to respond. The website may be down, or you may be experiencing issues with your Internet connection.
traceroute to 121.12.175.19 (121.12.175.19), 64 hops max, 52 byte packets 1 bogon (192.168.102.1) 1.928 ms 1.064 ms 1.557 ms 2 bogon (192.168.3.251) 0.893 ms 1.096 ms 1.290 ms 3 221.4.48.98 (221.3.48.98) 3.593 ms 8.879 ms 3.404 ms 4 120.80.173.73 (120.81.173.73) 8.358 ms 6.049 ms 120.80.173.69 (120.81.173.69) 3.562 ms 5 120.84.0.49 (120.84.0.49) 3.238 ms 3.240 ms 120.83.0.89 (120.83.0.89) 7.432 ms 6 219.158.14.241 (219.158.14.241) 4.793 ms 5.700 ms 219.158.19.9 (219.158.19.9) 3.718 ms 7 219.158.15.230 (219.158.15.230) 4.028 ms 4.554 ms 219.158.22.138 (219.158.22.138) 4.507 ms 8 202.97.15.169 (202.97.15.169) 7.733 ms 5.502 ms 7.867 ms 9 202.97.63.85 (202.97.63.85) 6.789 ms 5.671 ms 8.205 ms10 183.61.221.105 (183.61.221.105) 4.051 ms 4.543 ms 4.620 ms11 183.59.13.222 (183.59.13.222) 12.053 ms 10.832 ms 9.027 ms12 183.60.128.178 (183.60.128.178) 7.896 ms 12.108 ms 7.790 ms13 113.105.160.174 (113.105.160.174) 9.567 ms 11.880 ms 11.964 ms14 * * *15 121.12.175.19 (121.12.175.19) 8.581 ms 41.236 ms 47.295 ms
ping是很快,但???面很慢,可以??放一????面看看。
print_r(get_headers('http://121.12.175.19'));
Array( [0] => HTTP/1.1 200 OK [1] => Date: Thu, 02 Apr 2015 02:53:44 GMT [2] => Server: Apache/2.2.21 (Win32) PHP/5.3.10 [3] => X-Powered-By: Ftxia 6.0 [4] => Set-Cookie: PHPSESSID=q90d1eae6c799rc3srg02c0da0; path=/ [5] => Expires: Thu, 19 Nov 1981 08:52:00 GMT [6] => Cache-Control: private [7] => Pragma: no-cache [8] => Connection: close [9] => Content-Type: text/html; charset=utf-8)应该没有问题的
是否你指定了来源?
echo file_get_contents('http://121.12.175.19');
<!doctype html><html class="0663ec-pc w1200"><head><title> 左航网</title><meta name="keywords" content="" /><meta name="description" content="" /><meta name="generator" content="0663ec" /><meta name="renderer" content="webkit"><meta name="version" content="2015-1-1 0663.ec"><meta name="MSSmartTagsPreventParsing" content="True" /><meta http-equiv="MSThemeCompatible" content="Yes" /><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">........是你的吗?
echo file_get_contents('http://121.12.175.19');
<!doctype html><html class="0663ec-pc w1200"><head><title> 左航网</title><meta name="keywords" content="" /><meta name="description" content="" /><meta name="generator" content="0663ec" /><meta name="renderer" content="webkit"><meta name="version" content="2015-1-1 0663.ec"><meta name="MSSmartTagsPreventParsing" content="True" /><meta http-equiv="MSThemeCompatible" content="Yes" /><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">........是你的吗? 不是,不是这个
echo file_get_contents('http://121.12.175.19');
<!doctype html><html class="0663ec-pc w1200"><head><title> 左航网</title><meta name="keywords" content="" /><meta name="description" content="" /><meta name="generator" content="0663ec" /><meta name="renderer" content="webkit"><meta name="version" content="2015-1-1 0663.ec"><meta name="MSSmartTagsPreventParsing" content="True" /><meta http-equiv="MSThemeCompatible" content="Yes" /><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">........是你的吗? 是我的呢,我没有指定来源呢,在哪里查看是否被指定来源了。
ping是很快,但???面很慢,可以??放一????面看看。
试过放静态页面了,也是一样的
比?奇怪,file_get_contents可以?取到,用curl和??器不行。
66665: SOCKET
121.12.175.19:80
Start Time: 2015-04-02 11:42:19.225
t=189357 [st= 0] +SOCKET_ALIVE [dt=17977]
--> source_dependency = 66662 (CONNECT_JOB)
t=189357 [st= 0] +TCP_CONNECT [dt=11]
--> address_list = ["121.12.175.19:80"]
t=189357 [st= 0] TCP_CONNECT_ATTEMPT [dt=11]
--> address = "121.12.175.19:80"
t=189368 [st= 11] -TCP_CONNECT
--> source_address = "192.168.101.217:54525"
t=189368 [st= 11] +SOCKET_IN_USE [dt=17966]
--> source_dependency = 66678 (HTTP_STREAM_JOB)
t=189368 [st= 11] SOCKET_BYTES_SENT
--> byte_count = 437
t=207334 [st=17977] SOCKET_READ_ERROR
--> net_error = -7 (ERR_TIMED_OUT)
--> os_error = 60
t=207334 [st=17977] -SOCKET_IN_USE
t=207334 [st=17977] -SOCKET_ALIVE
是你的不就对了吗?
能访问还不行吗?
用程序能抓取到,但用浏览器打不开。
显然你的网站中的 js 有问题
是你的不就对了吗?
能访问还不行吗?
用程序能抓取到,但用浏览器打不开。
显然你的网站中的 js 有问题
不是的,使用curl也不行。另外,如果是js??,
view-source:http://121.12.175.19/
??就不??用js了,也不能??。
是你的不就对了吗?
能访问还不行吗?
用程序能抓取到,但用浏览器打不开。
显然你的网站中的 js 有问题
但是为什么我本地用浏览器能打开呀,而且我把网站换成静态页面,用浏览器也不能打开呢。应该不是JS的问题吧
只能理解为 防火墙挡住了
只能理解为 防火墙挡住了
防火墙关了的
你把主页改了吗?
112233
你把主页改了吗?
112233
可是用浏览器还是访问不了,用file_get_contents又能获取到,我的系统是win2003的。
用域名吧!应该可以的
用域名吧!应该可以的
试过了,用域名也不行的。。 域名是:www.jmsugou.comping域名也是通的
Order deny,allow
Allow from all
Order deny,allow
Allow from all
用 file_get_contents 能抓取到,就表示网站设置并没有问题
所以请不要在apache 的配置上找原因
Order deny,allow
Allow from all
如果是通过路由器或者交换机什么的!需要做一下ip映射!
Order deny,allow
Allow from all
如果是通过路由器或者交换机什么的!需要做一下ip映射! 独立IP,没路由器,不用做映射的呀
用 file_get_contents 能抓取到,就表示网站设置并没有问题
所以请不要在apache 的配置上找原因
最好贴出httpd.conf中的directory那几段
?不?限制了user-agent?
为神哦咧,这个问题
?主解?了??
?主解?了??
后来换了wamp2.4的版本,配置好后,能访问了。但是新问题又来了,apache启动几分钟之后,就访问不了,必须重启后才能访问,过几分钟又访问不了。我看错误日志,提示指定的网络名不再可用,然后我关掉了AcceptEx,就没这个错误了,但是还是访问不了。而且错误日志和访问日志都没记录了。
1.文件目录权限
2.服务器设置
3.如果是使用gii生成东西 的话,有ip限制
是权限设置的问题…把网站文件夹设为744?
搞不定了,我把aphche换成了IIS,现在正常了。感谢大家的热情帮助,现在结贴!

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver Mac version
Visual web development tools
