Localhost db testing

I am trying to test locally with some sql/php code.  I am familiar with php/sql, but not with using workbench, or local hosting.  so I set up a site called localhost, and i set "connect using:" to local/network.  i set the web url to 127.0.0.1/.  I wrote up some simple php to connect to my local db that I have created and running:
<?php
mysql_connect("localhost", "root", "password") or die(mysql_error());
echo "Connected to MySQL";
mysql_select_db("movies") or die(mysql_error());
echo "Connected to Database";
?>
I view the page in Firefox, and nothing shows up.  I even try to echo something before the connection, still nothing.  I view the source code, and everything looks right.  What am I missing?

Just to verify some basics...
Have you installed Apache, mySQL and PHP on your local machine? (XAMPP or MAMP are most common)
Is your local server running?
When you view the source code in Firefox of your previewed page, do you see your php code or is it mostly blank?
Have you saved your page with the php script as .php or .html?
When you preview, are you using Preview in Browser, or are you connecting to the files on your local test server using "localhost/yoursite/yourpage.php"

Similar Messages

  • Css files not updating in localhost (XAMPP test server)

    I've got an issue with a web page I'm developing where the .css files that I attach to the pages will not update on my local host.  I can make a copy of the file with a different name and link it to the page.  However, if I name any file a name that I've already used then the CSS reverts to whatever was on the original documents.  This is making my php page testing a pain when I view the page in a browser.  The problem doesn't seem to occur for my other websites, and completely goes away when I select "none" in the testing server options.  I'm using XAMPP to run my localhost testing server.  I'm using Dreamweaver CS4 on a Vista machine.  Any ideas?  If nothing else it would be nice to know how to delete the old files that are stuck in the testing server directory.

    Strange thing...  I turned it off and walked away for a few hours.  Upon my return I found the issue resolved.  I blame the shoe elves.  Thanks, you little guys!

  • Site-relative links fail on local testing server

    Using CS4/WAMP/XP, I have a testing server set up. All works well except that when I specify site-relative links, on the testing server they go back to localhost, not localhost/Frances. They work fine on the live site, but not on my testing server.
    This prevents me from using (well, testing) 'include' files for things like menus when parts of the site are in different folders.
    I have my site setup as follows:
    Local Info
    Site name "FFG2009"
    Local root folder C:\wamp\www\Frances\
    Default images folder C:\wamp\www\Frances\images\
    HTTP Address: http://localhost/Frances/
    Testing Server
    Server model: PHP/MySQL
    Access: Local/Network
    Testing Server Folder: C:\wamp\www\Frances testing\
    URL Prefix: http://localhost/Frances/
    In my Apache config file I have a virtual directory set up like this
    Alias /Frances/ "c:/wamp/www/Frances/"
    <Directory "c:/wamp/www/Frances/">
        options all +includes
        AllowOverride all
        Order allow,deny
        Allow from 127.0.0.1
    </Directory>
    I have been advised that I could temporarily change the Apache webroot folder to my "Frances" folder, but that stops other things like PHPMyAdmin from working. Also I have other sites within my www directory and I'd rather not have to change the Apache rootweb directory every time I need to work on a different site.
    Is there a way to set up my site in CS4 so that site root links go to localhost/Frances rather than just localhost?
    Thanks
    Tone'z

    Many thanks Mark.
    I fact I spent all yesterday coming to the same solution. Finally at around 12:30am this morning it worked!
    Early in the day I found the same reference you mentioned in an on-line copy of David Power's book where he exactly described the very problem I had - and with the VH solution.
    However, I had a problem with an obscure syntax error in the virtual hosts include file. I still don't know what it was. The flag to perform a syntax check on HTTPD startup didn't discover it. The problem actually prevented the Apache service from starting at all but that little point escaped me for a long time because the WAMP system tray icon is so small I didn't spot that it was telling me "some services are running" (half yellow) instead of "all services are running" (white).
    It wasn't until I ran (in desperation!) Apache Monitor that it became obvious that Apache was tripping over this virtual host definition and failing to start.
    It also seems that if you have any virtual host directive in an include file, then it negates the localhost directive in the Apache config file. So when I define the Frances virtual host, I also need to have localhost defined in the include file.
    It was this localhost directive that was causing the problem. I found it by having Apache Monitor running so I can see the true state of the Apache service and, after pointing the config file 'include' directive to a vhosts file...
    empty the vhosts file - Apache starts - 'localhost' works, frances doesn't - makes sense.
    add the frances virtualhost definition to the vhosts file - Apache starts -  'frances' goes to the frances site, 'localhost' does too (dam')
    add the localhost virtualhost definition to the vhosts file - Apache fails to start - "IE cannot display this page"
    pull out the localhost definition - Apache starts... hmmmm... .
    find an example localhost definition from somewhere else - to all intents and purposes identical to mine - add it in - Apache starts!
    Both localhost and frances now work! Maybe there was a space where no space should be - I don't know.
    Of course I also had to add entries into windows/system32/drivers/etc/hosts to point to 127.0.0.1.
    Oh yes, virtualhosts are fussy about folder names. You cannot have spaces in a folder name.
    Thanks
    Tone'z

  • Test.jsp not able to display the output from the java code.

    when i try to invoke http://localhost/papz/test.jsp
    I dont see anything. The page is blank. And there are no error messages in any log files. When i click on view source in IE i get to see the entire source code, including the jave code.
    <html>
    <head>
    <title>Test</title>
    <body>
    <%
    out.println("Hello World");
    %>
    asdfasdfasdf
    </body>
    </html>
    i added in the asdfasdf to see whehter it will be printed or not... It does print that stuff out.
    when i try to invoke the login.jsp page, i get the dialog box "save this file to disk"
    Any clues whats going on...?
    I followed the instructions...over and over again... but it doesnt seem to help.
    win nt 4.0
    apache 1.3.12
    jserv 1.1.1
    Pls help. Thanks

    Hi,
    Have you solved your problem?
    I4m trying to do the same, but I installed portal 30, then portal to go, and when I try to run test.jsp I get the following error:
    Request URI:/papz/test.jsp
    Exception:
    java.lang.NoSuchMethodError: oracle.jsp.util.JspUtil: method
    stripTarget(Ljava/lang/String;C)Ljava/lang/String; not found
    Thanks
    Pablo Lopera
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by NewBie:
    when i try to invoke http://localhost/papz/test.jsp
    I dont see anything. The page is blank. And there are no error messages in any log files. When i click on view source in IE i get to see the entire source code, including the jave code.
    <html>
    <head>
    <title>Test</title>
    <body>
    <%
    out.println("Hello World");
    %>
    asdfasdfasdf
    </body>
    </html>
    i added in the asdfasdf to see whehter it will be printed or not... It does print that stuff out.
    when i try to invoke the login.jsp page, i get the dialog box "save this file to disk"
    Any clues whats going on...?
    I followed the instructions...over and over again... but it doesnt seem to help.
    win nt 4.0
    apache 1.3.12
    jserv 1.1.1
    Pls help. Thanks<HR></BLOCKQUOTE>
    null

  • Can't see design view after changing connections file from localhost to a remote host & back again

    I was using localhost to test files before changing the connections document over to a remote host, since I couldn't get dreamweaver to connect to the remote host, I changed back to localhot. My files are all .php files. This is a dynamic site. After I changed my connection back to my local host my design view no longer works. It's competly grey with 3 small icons at the top on the left. I can view in live view and I can view in the browser. But no longer in design view after being able to for 6 months. The 3 icons are a hard drive case, a document, and a link symbol . When I click in code view the design view turns grey when I click in design view it turns white. I am using wamp for the localhost, Windows XP home, Dreamweaver CS5. Can someone please tell me how to go back to design view. This happens with any & all files including non dynamic .html files. Also having a problem connecting to my remote host. using godaddy, and they have tried with me for 2 hours to connect, I just keep getting password is incorrect. Thank you for any help, Stacey

    I would also recommend clearing the Site cache, which may help with the connection failure. To do so, choose Site > Advanced > Recreate Site Cache.
    After doing so, be sure to go back into your Site Setup, and make sure the FTP address, user name, and password are all correct. (Click the Test button in there to verify.)
    If that doesn't help with getting connected to your server, you might try an alternate FTP client (e.g. FileZilla) to just make sure you are entering the right connection information. It could be that GoDaddy is having some issue, or maybe you just mistyped something (I know I do this often when I type too fast).
    As for the issue with Design View, try clearing the Dreamweaver cache. Instructions are here: http://forums.adobe.com/thread/494811
    You might also try toggling the location of Design View. That is, when in Split View, choose View > Design View On Left. Then, choose that menu option again to reset the location back to the right.
    Resetting the workspace might also be recommended. Window > Worksapce Layout > Reset 'name of current workspace'

  • Testing Server Settings

    i am having a problem establishing my testing server so that
    I can develop asp or asp.net pages in DW MX 2004 on a VISTA client.
    I would be most appreciative if someone might be able to help me
    out with this. Here are my settings in the SITE DEFINITION DIALOGUE
    BOX:
    LOCAL INFO
    Site Name: TESTING
    Local Root Folder: c:\Inetpub\wwwroot\testing\
    (refresh local file list automatically is checked)
    HTTP Address:
    http://localhost/wwwroot/testing/
    REMOTE INFO
    Access: Local/Network
    Remote Folder: c:\inetpub\wwwroot\testing\
    TESTING SERVER
    Server Model: ASP VB Script
    Access: Local/Network
    Testing Server Folder: C:\Inetpub\wwwroot\TESTING\
    URL Prefix:
    HTTP://localhost/wwwroot/testing/
    Thanks for any assistance you might be able to offer

    Well,
    this might looks like weird question, but are you sure that
    you did setup your web server properly on Vista? I guess you have
    windows vista business, enterprise, or Ultimate edition, because
    those are the only editions that support webserver.
    However, can you say the error message appears to you in
    Dreamweaver?

  • Testing site when creating new site

    I am trying to setup a new site for DW8. Looks easy enough
    but I keep getting this one error message.
    Dreamweaver cannot use the prefix you entered to display live
    data. (error 12029)
    this is the data that I have entered to setup the site on the
    basics tab:
    what would you like to name your site?
    1purposebethel
    What is the HTTP adress (URL) of your site?
    http://www.1purposebethel.org/
    Yes I want to use a server technology
    PHP MySQL
    Edit and test locally (my testing server is on this computer)
    C:\inetpub\wwwroot\1purposebethel\
    What URL would you use to browse to the root of your site?
    http://localhost/1purposebethel/
    test URL message:
    Dreamweaver cannot use the prefix you entered to display live
    data. (error 12029)
    can you advise?
    Kevin

    Resolved
    Thank You
    Kevin
    "kevin raleigh" <[email protected]> wrote in
    message
    news:f42e75$kc$[email protected]..
    > I am trying to setup a new site for DW8. Looks easy
    enough but I keep
    getting
    > this one error message.
    > Dreamweaver cannot use the prefix you entered to display
    live data.
    (error
    > 12029)
    >
    > this is the data that I have entered to setup the site
    on the basics tab:
    >
    > what would you like to name your site?
    > 1purposebethel
    >
    > What is the HTTP adress (URL) of your site?
    >
    http://www.1purposebethel.org/
    >
    > Yes I want to use a server technology
    > PHP MySQL
    >
    > Edit and test locally (my testing server is on this
    computer)
    > C:\inetpub\wwwroot\1purposebethel\
    >
    > What URL would you use to browse to the root of your
    site?
    >
    http://localhost/1purposebethel/
    >
    > test URL message:
    >
    > Dreamweaver cannot use the prefix you entered to display
    live data.
    (error
    > 12029)
    >
    > can you advise?
    > Kevin
    >

  • The requested resource (/mytest/test.jsp) is not available.

    JSP and Java are NEW for me.
    I have prepared Linux server with Tomcat and Apache servers, connect it to using mod_jk.
    Apache and Tomcat are work fine following LINK.
    http://localhost/examples/jsp/
    But , when I access JSP from my folder which I made it same folder "examples" is not working.
    http://localhost/mytest/test.jsp (This is my folder which i want to call all my JSP file.)
    It display following error message:
    Apache Tomcat/4.0.4 - HTTP Status 404 - /mytest/test.jsp
    type Status report
    message /mytest/test.jsp
    description The requested resource (/mytest/test.jsp) is not available.
    What can i do, HELP ME.

    I STILL have some problem with JSP.
    I have prepared Linux server with Tomcat and Apache servers, connect it to using mod_jk.
    Apache and Tomcat are work fine following LINK.
    http://localhost/examples/jsp/
    But , when I access JSP from my folder which I made it same folder "examples" is not working.
    http://localhost/mytest/test.jsp
    (This is my folder which i want to call all my JSP file.)
    It display following error message:
    Apache Tomcat/4.0.4 - HTTP Status 404 - /mytest/test.jsp
    type Status report
    message /mytest/test.jsp
    description The requested resource (/mytest/test.jsp) is not available.
    What can i do, HELP ME ???

  • Cannot use php mail() function in leopard's localhost

    <?php
    $to = "[email protected]";
    $subject = "test subject";
    $message = "test message";
    $from = "[email protected]";
    $headers = "From: $from";
    mail($to, $subject, $message, $headers)
    ?>
    This code doesn't work on my localhost but when I uploaded it to my sever it run normaly. Then how can I use the mail function on my localhost to test it before I need to publish it to my server

    Have you started the mail server on your machine?
    By default PHP will try to use the local mail server to send the message. If you haven't started Postfix the message will go nowhere.

  • Setup of Customer Dev and Test environment

    Customer wants to set up a Dev and Test env for Apex on the same machine. Been trying to wrap my head around the way to do this. Seems like these are the options:
    1) Separate databases, Two APEX homes, Two HTTP Servers
    2) One database, different Workspaces, One APEX home, One HTTP Server
    # 1 is the most 'pristine' from the perspective of separation of everything (and patching), but #2 seems like a more manageable environment. Only down side I see to #2 is that DEV can never have a newer release of APEX than TEST.
    BTW -the customer wants TEST to look like PROD except during code push time. They also want TEST env refreshed regularly from PROD in between code releases.
    Suggestions? Other options?
    Thanks,
    Dwight

    Hello Dwight,
    Check your dads.conf file. There is something like this:
    <Location /pls/apex>
    Order deny,allow
    PlsqlDocumentPath              docs
    AllowOverride                  None
    PlsqlDocumentProcedure         wwv_flow_file_mgr.process_downloadd
    PlsqlDatabaseConnectString     localhost:1521:XE ServiceNameFormat
    PlsqlNLSLanguage               AMERICAN_AMERICA.AL32UTF8
    PlsqlAuthenticationMode        Basic
    SetHandler                     pls_handler
    PlsqlDocumentTablename         wwv_flow_file_objects$
    PlsqlDatabaseUsername          APEX_PUBLIC_USER
    PlsqlDefaultPage               apex
    PlsqlDatabasePassword          apex_public_user
    PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
    Allow from all
    </Location>You can easily change the Location - /pls/apex - to (e.g.) /dev add another Location (/test) and provide it with the different connect strings.
    Then you can access your Dev environment using http://localhost:7778/dev and Test with http://localhost:7778/test.
    You can also change the (default) settings to your /i/ (virtual) directory to point to different dev and test directories.
    Example:
    Alias /dev/ "c:\Oracle\OAS\Apache/dev/images/"
    Alias /tst/ "c:\Oracle\OAS\Apache/test/images/"
    and change the value of the Image Prefix in your Application Definition accordingly.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • JAX-WS how do I trigger a method from browser to test it?

    I deployed a webservice as follows:
    @WebService
    public class TestWebServiceImpl implements TestWebService {
         @Override
         @WebResult(name = "DoTest")
         public void doTest() {
              System.out.println("DoTest triggered");
    <endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0" Content-type="text/xml">
    <endpoint
    name="TestService"
    implementation="com.test.webservice.impl.TestWebServiceImpl"
    url-pattern="/dotest"
    />
    </endpoints>
    <servlet>
    <servlet-name>TestService</servlet-name>
    <servlet-class>
         com.sun.xml.ws.transport.http.servlet.WSServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestService</servlet-name>
    <url-pattern>/dotest</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>120</session-timeout>
    </session-config>
    No I can trigger the wsdl by hitting:
    http://localhost:9001/test/dotest
    but how do I directly trigger the method "doTest" so I see that system out generated?

    SoapUI is a common way of testing webservices. But you could also simply generate client stub classes using the jax-ws wsimport tool and stick them in a command line application.

  • If I am using my localhost do I still need home/usr/public_htm?

    Hi,
    I am just using my localhost to test some rmi programes but when I referenced java's doc* they are saying define directories for public accessabilities like /home/usr/public_html. My question: is it neccessary to do that while I am on my LOCALHOST!. Please help
    Thanks in advance

    Thsi for you help.
    but have you seen this:
    When you build either server- or client-side classes with the javac and rmic compilers, you generally need to specify where the resulting class files should reside so that they are network accessible. In this example this location is, for UNIX, /home/user/public_html/classes, because some web servers allow accessing a user's public_html directory via an HTTP URL constructed as http://host/~user/. If your web server does not support this convention, you could use a file URL instead. The file URLs take the form file:/home/user/public_html/classes/ on UNIX or, on the Win32 platform, file:/c:/home/user/public_html/classes/. You may also select another type of URL, as appropriate.

  • Staging server? Development? Testing? Arghhh!

    First off, let me preface this posting by letting you know that I have been a front-end developer for many years with only a basic understanding of what goes on at the server level. I do have a server administrator (read boss) whom has tasked me with finding answers to the situation I will be (trying) to describe below. I have been using Adobe products, including DW, for more than ten years and am currently using DW CS5.
    I am having trouble understanding the differences between, and the different uses for, staging, development and testing servers. I know what local and remote/production servers are, but (with the exception of a testing server) I don't know if "staging" and "development" are different terms that can be interchanged with either (or both) of them.
    Currently, and for many years prior, I have only had local and remote locations set up for my various sites. However, I would like to now move to a set-up where I can do my local work, then push my files to a location for testing —BTW, by using the word "testing", I am not implying that I believe it should necessarily be a "testing" server used— then finally, after the page(s) look/function correctly, push the files up onto a production server.
    Right now if I Ctrl-Shift-U (or put) my files, they go straight to my remote server. How can I do an  intermediary step that sends files to a location for testing, and then will push the files further up the chain once additions/changes have been approved?
    I've also heard the term WAMP bantied about, yet don't know if this would apply to me. And what about Subversion? Should I be using that in conjunction with the objective I am trying to achieve? (Okay, my head is really starting to spin now.)
    Thanks in advance for any help provided.
    Cheers!
    James

    i will try to make this simple, i think that many other guys may agree
    what i would you if i were you would be
    install WAMP.
    set up a dreamweaver site
    this will let you test your sites locally. Then, when they are ready you can upload them to a remote server. this local server can be a "localhost" adress in your computer not necesarily uploaded unless you check the "automatically upload files to server on save"
    set up a remote server with your ftp.
    with this you can have a site to test all what you want and another to publish. if you are in a collaborative ecosystem, you may a a localhost shared in some way.
    hpe this will be helpfull. it is very simple. and let me recap: localhost for test and ftp to publish. and that all. if you can you may have a hidden folder in yor ftp and send that folder to test :
    http://yoursite.com/hiddenfortest/index.html,php

  • How to change domain name from "LocalHost" to ipaddress in Jdeveloper?

    Hi
    When i run any application from JDeveloper, the page opening with the URL keeping "*LocalHost*" as a domain name,
    eg: http://*localhost*:7101/Testing/faces/index.jsf
    How can i change the domain name from "localHost" to my system's ipaddress. So that whenever i execute the page, the page should open with the ipaddress and not with "localhost", like http://*10.34.65.175*:7101/Testing/faces/index.jsf
    Regards
    Raj

    Thank you Timo.
    I changed domain name from "localhost" to ipaddress as you said, after that the server stopped working. Unable to run any application.
    Then I changed it back to "localhost" and its working fine.
    I am doing it for 2 reasons,
    1) With localhost as domain name, I am unable to open ADF mobile browser application in Android emulator.
    2) Unable to do remote debugging. Hope this could be the reason.
    Regards
    Raj

  • Configure localost and extension for test site

    Hi, I'm on my first attempt at setting up a site and using an
    extension. I dl'd the login extension from Adobe but seem to have a
    problem with the URL it is passing. My site is set up for "
    http://localhost:8500/test".
    A successful login calls "index.cfm". What is apparently getting
    passed is "
    http://localhost:8500/test//test/login.cfm".
    Somewhere in configuring things I put in too much, but I can't seem
    to track it down. Help is appreciated as this will affect all my
    testing as you might guess. Thanks.

    Hi, I'm on my first attempt at setting up a site and using an
    extension. I dl'd the login extension from Adobe but seem to have a
    problem with the URL it is passing. My site is set up for "
    http://localhost:8500/test".
    A successful login calls "index.cfm". What is apparently getting
    passed is "
    http://localhost:8500/test//test/login.cfm".
    Somewhere in configuring things I put in too much, but I can't seem
    to track it down. Help is appreciated as this will affect all my
    testing as you might guess. Thanks.

Maybe you are looking for