localhost

Connection to db using php in localhost

青春壹個敷衍的年華 提交于 2019-12-12 03:19:26
问题 Even if I have used LAMPP many times, this time something goes wrong. When I visit the browser(chrome) nothing echos. Here is my code: index.php <?php error_reporting(E_ALL); /*after edit*/ $link = mysqli_connect('localhost', 'root', 'root', 'db'); if (!$link) { die('Could not connect: ' . mysqli_error()); } echo 'Connected successfully'; mysqli_close($link); ?> Do I miss something? The output is nothing. By the way i write my files in var/www/html/my_pages and i call it this way: localhost

Two Copies of Magento Installation on Localhost

故事扮演 提交于 2019-12-12 02:59:20
问题 My goal is two have two versions of Magento installed in my Sites/ folder. One is the current version we are using (1.12), and the other is the upgraded version (1.14). There are several reasons why I need to do this. Another developer upgraded Magento and sent over the site files, which I put in Sites/magento2.dev, and I also have the working original in Sites/magento1.dev. I created a separate database, imported the dump from the upgraded version, and put this in the local.xml file for

Java local hostname ip resolution

我与影子孤独终老i 提交于 2019-12-12 02:59:06
问题 I am running into a weird issue on my macbook pro where hostname to ip resolution. Here is the code, import java.net.InetAddress; public class IpRes { public static void main(String[] args) throws Exception { String host = args[0]; InetAddress address = InetAddress.getByName(host); System.out.println(address.getHostAddress()); } } My host name is "a-b-vik". I have entries in /etc/hosts for 127.0.0.1 localhost 127.0.0.1 a-b-vik Here is output when I run the above program, java IpRes "localhost

WCF Hosting with IP Address

荒凉一梦 提交于 2019-12-12 02:12:55
问题 I have created a WCF Service which return JSON data. here is my code: namespace AppServices { [ServiceContract] public interface Service1 { [OperationContract] [WebInvoke(Method = "GET", UriTemplate = "/GetCities", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] List<City> GetCityCode(); } [DataContract] public class City { [DataMember] public string CityId { get; set; } [DataMember] public string CityName { get;

predictionio: why can I make post requests with curl but not python?

孤街浪徒 提交于 2019-12-12 01:54:28
问题 I am trying to import data into predictionio. I can send each event individually with curl fine: curl -i -X POST http://localhost:7070/events.json?accessKey=285285285 \ -H "Content-Type: application/json" \ -d '{ "event" : "buy", "entityType" : "user", "entityId" : "u1", "targetEntityType" : "item", "targetEntityId" : "i2", "eventTime" : "2014-11-10T12:34:56.123-08:00" }' HTTP/1.1 201 Created Server: spray-can/1.3.3 Date: Fri, 23 Dec 2016 00:02:32 GMT Content-Type: application/json; charset

WAMP: Cannot Connect To Localhost

走远了吗. 提交于 2019-12-12 01:29:00
问题 I'm just stuck on one little thing here but here is what I've done so far using websites and video tutorials (Note: I'm Running on Windows 10 and using Microsoft Edge as a browser for WAMP). Disabled Skype I went into the little WAMP menu/apache/httpd.conf and changed LISTEN to port 81. It still said port 80 was being used by Windows IIS 10.0 so I went into the Command Prompt as admin and used "iisreset /stop". Now WAMP is green and online, yay. I enter localhost at the top of the WAMP menu

Client server connection on loopback interface

匆匆过客 提交于 2019-12-12 00:53:10
问题 I'm trying to test a client-server simple implementation using localhost address. Here's the code. Server: /* * Sequential busy-waiting */ int main(int argc, char** argv) { int opt, client_addr_l, errsv; unsigned short port; struct sockaddr_in server_addr, client_addr; /* ... */ printf("Port number retrieved (%d), server is starting ...\n", port); /*TCP Socket creation*/ sock_ds = socket(AF_INET, SOCK_STREAM, 0); if(sock_ds == -1){ fprintf(stderr, "Socket creation error: %s\n", strerror(errno

HTTP GET request in java

时光总嘲笑我的痴心妄想 提交于 2019-12-11 23:15:15
问题 I'm trying to use http get request on java, to my localhost on port number 4567. I got the get request: "wget -q -O- http://localhost:4567/XXXX" [XXXX is some parameter - not relevent]. I've found a java library java.net.URLConnection for these kind of things but it seems that the URLConnection object is supposed to receive the url/port/.. and all other kind of parameters (In other words, you have to construct the object yourself), however, I got the full http get request as I've written

MAMP not connecting to localhost

六眼飞鱼酱① 提交于 2019-12-11 20:53:53
问题 Just updated MAMP to version 3.2.1 on Yosemite. Both Apache and MySQL servers are green but when I go to my localhost I keep getting: This webpage is not available ERR_NAME_NOT_RESOLVED in browser (Chrome). I’ve tried incognito browsing and Firefox with the same result, tried both the MAMP default port settings and ports 80 & 3306, tried a reinstall of MAMP and rolling back to previous install of MAMP; all without success. Can anyone suggest how to fix this…it’s starting to drive me crazy!

Wamp 2.5 local host doesn't work after I have setup virtual hosts I get 403 forbidden error

心已入冬 提交于 2019-12-11 20:52:52
问题 I have setup virtual hosts now when I type localhost it does not work I figured that now I'll have to make a virtual host for local host it self and it worked but now when I type my external ip it does not work it says 403 forbidden so how do i fix this do I have to make a virtual host for my external ip and will it work for everyone or just my computer for example if I give to a friend and he typed my external ip will it work? 回答1: When you create Virtual Hosts, Apache ignored the host