localhost

Trying to write a file to a different directory using fopen()

南楼画角 提交于 2019-12-05 04:51:35
I'm trying to write a file from one directory to another. For example, http://www.xxxxxxx.com/admin/upload.php to http://www.xxxxxxx.com/posts/filename.php I've read that I cannot write a file by using the HTTP path, how do I use a local path? $ourFileName = "http://www.xxxxxxxx.com/articles/".$thefile.".php"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); You should use the absolute or relative path to the file on the file system. <?php $absolute_path = '/full/path/to/filename.php'; $relative_path = '../posts/filename.php'; // use one of $absolute_path or $relative_path

安装zookeeper时候,可以查看进程启动,但是状态显示报错:Error contacting service. It is probably not running...

。_饼干妹妹 提交于 2019-12-05 04:49:15
安装zookeeper-3.3.2的时候,启动正常没报错,但zkServer.sh status查看状态的时候却出现错误,如下: JMX enabled by default Using config: /hadoop/zookeeper/bin/../conf/zoo.cfg Error contacting service. It is probably not running. jps查看进程,却发现进程已启动 7313 QuorumPeerMain 在网上查阅资料一共有三种解决方法: 1,打开zkServer.sh 找到status) STAT=`echo stat | nc localhost $(grep clientPort "$ZOOCFG" | sed -e 's/.*=//') 2> /dev/null| grep Mode` 在nc与localhost之间加上 -q 1 (是数字1而不是字母l) 如果已存在则去掉 注:因为我用的zookeeper是3.4.5版本,所以在我的zkServer.sh脚本文件里根本没有这一行,所以没有生效 2,调用sh zkServer.sh status 遇到这个问题。百度,google了后发现有人是修改sh脚本里的一个nc的参数来解决,可在3.4.5的sh文件里并没有找到nc的调用。配置文档里指定的log目录没有创建导致出错

kafka 安装教程

寵の児 提交于 2019-12-05 04:29:49
安装详述: https://www.jianshu.com/p/596f107e901a 3.0:运行:cd 到: D:\Installed_software\Professional\kafka_2.10-0.10.0.1 而不是:D:\Installed_software\Professional\kafka_2.10-0.10.0.1\bin\windows .\bin\windows\kafka-server-start.bat .\config\server.properties \bin\windows\kafka-server-start.bat \config\server.properties 4. 创建一个topic: cd D:\Installed_software\Professional\kafka_2.10-0.10.0.1\bin\windows kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic

Permission denied when opening localhost

断了今生、忘了曾经 提交于 2019-12-05 03:51:00
I had recently installed Apache, PHP and MySQL in Ubuntu. And copied the files I created to the var/www directory. But when I open http://localhost it is showing Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/var/www/index.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0 How can I run my project normally? It was working fine in windows. According to this article, you need to give read/execute permissions to Owner, Group, and Everyone. Set permissions on the problem file to 777. Note, you

Android cannot access localhost?

霸气de小男生 提交于 2019-12-05 03:30:42
I started a local http server on Android and it can be reached by other computers in the same local network. But if I try to access this server using opera on the same phone, it won't work. So this means we are not able to access localhost on Android? Thanks! You shoud use next IP 10.0.2.2 Just check this http://developer.android.com/guide/developing/devices/emulator.html#networkaddresses If ur app running in localhost:3000, then try to use as 10.0.2.2:3000 in your android emulator user3583986 Try to use your ip address in your pc (ipconfig to see the ip address for your pc) IPv4 Address. . .

nginx 配置

流过昼夜 提交于 2019-12-05 03:18:52
nginx 安装 1. yum安装 123456789101112 [root@localhost ~]# rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm# 2.查看nginx信息[root@localhost ~]# yum info nginx# 3.使用yum安装ngnix[root@localhost ~]# yum install nginx# 4.启动nginx[root@localhost ~]# service nginx start# 5.查看nginx版本[root@localhost ~]# nginx -v# 6.访问nginx,现在你可以通过公网ip (本地可以通过 localhost /或 127.0.0.1 ) 查看nginx 服务返回的信息。[root@localhost ~]# curl -i localhost 2. 源码安装 1234567891011121314 # 1.下载nginx包。[root@localhost ~]# wget http://nginx.org/download/nginx-1.14.0.tar.gz#2.复制包到你的安装目录[root@localhost ~]#

修改主机名的规范步骤

时光毁灭记忆、已成空白 提交于 2019-12-05 02:57:13
1. hostname 进行修改,临时生效 [root@oldboy network-scripts]# hostname oldboy [root@oldboy network-scripts]# hostname newname [root@oldboy network-scripts]# hostname newname 2. 修改/etc/sysconfig/network文件,永久生效 [root@oldboy sysconfig]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=oldboy vi或sed替换更改为newname,重启就生效了 3. 修改/etc/hosts配置文件中的主机名对应的名称 [root@oldboy sysconfig]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain4 如果用setup--dns设置修改主机名,永久生效。 来源: https://www.cnblogs.com/zoe233/p/11900324

nginx跨域

和自甴很熟 提交于 2019-12-05 02:55:08
摘自 https://www.cnblogs.com/BoatGina/p/8409549.html 使用场景:本地运行一个项目,但是要访问外域的api接口,存在跨域问题,解决方式有很多,但我尝试用nginx解决,搜索了网上文章后再加上尝试终于成功, 其中一些注意事项和大家分享一下。 一.window下使用nginx 重点: 掌握重启和关闭nginx的命令 1.安装: 在官网上选择适合的版本,我选的是window版本的: http://nginx.org/en/download.html,下载安装文件后解压,可以看到这样子: (不用双击nginx.exe) 配置文件路径: conf / nginx.conf 2.在命令行执行开启、关闭、重启命令: 开启:start nginx 关闭:nginx.exe -s quit 重启:nginx.exe -s reload (修改配置文件后需要重启才生效) 启动成功后,访问 localhost:80可以看到这个界面 : 二. nginx.conf文件配置 情况: 我本地运行一个项目,访问地址是 http://localhost:8888 用的是8888端口,我配置nginx使用的是80端口,也就是http://localhost:80 就可以访问到本地nginx服务器,我希望 http://localhost:8888 可以访问到 http:

docker running splash container but localhost does not load (windows 10)

不羁岁月 提交于 2019-12-05 02:50:32
问题 I am following this tutorial to use splash to help with scraping webpages.I installed Docker toolbox and did these two steps: $ docker pull scrapinghub/splash $ docker run -p 5023:5023 -p 8050:8050 -p 8051:8051 scrapinghub/splash I think it is running correctly, based on the prompted message in Docker window, which looks like this: However, when I open the `localhost:8050' in a web browser, it says the localhost is not working. What might have gone wrong in this case? Thanks! 回答1: You have

js获取页面url

喜夏-厌秋 提交于 2019-12-05 02:40:11
设置或获取对象指定的文件名或路径。 window.location.pathname 例:http://localhost:8086/topic/index?topicId=361 alert(window.location.pathname); 则输出:/topic/index 设置或获取整个 URL 为字符串。 window.location.href 例:http://localhost:8086/topic/index?topicId=361 alert(window.location.href); 则输出:http://localhost:8086/topic/index?topicId=361 设置或获取与 URL 关联的端口号码。 window.location.port 例:http://localhost:8086/topic/index?topicId=361 alert(window.location.port); 则输出:8086 设置或获取 URL 的协议部分。 window.location.protocol 例:http://localhost:8086/topic/index?topicId=361 alert(window.location.protocol); 则输出:http: 设置或获取 href 属性中在井号“#”后面的分段。 window