WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Using a non standard port (32 posts)

  1. Dan Boy
    Member
    Posted 1 year ago #

    Can anyone offer any assistance when using a non standard port. I am using WordPress with WAMP Server and while I have WAMP Server running on a different port WordPress won't find the database even if I give it the port number.

    Any help is much appreciated.

    Thanks Daniel.

  2. David Choi
    Member
    Posted 1 year ago #

    Are you referring to the MySQL port? because changing the Apache port shouldn't the affect MySQL connection.

    Here is a good tutor for changing Apache port, just in case you need it.

    http://stackoverflow.com/questions/8574332/how-to-change-port-number-for-apache-in-wamp

  3. Dan Boy
    Member
    Posted 1 year ago #

    Apache is fine and WAMP Server seems to be running with no problems, it is WordPress that is the problem as it won't seem to recognise that the port has changed even if I tell it e.g. localhost:1024 it still will not find the database.

    What more can I do, it is very frustrating.

    Cheers Daniel.

  4. David Choi
    Member
    Posted 1 year ago #

    What's the URL you are accessing it? Because WordPress doesn't care which port you are using, what's important is the port number from your browser, like:

    http://localhost:1024/

    or if you have a folder

    http://localhost:1024/wordpressfolder

    this port number is for Apache. If you also changed MySQL port for some reason (let's say it's 2000), then you have to edit the wp-config.php, change the host to:

    define('DB_HOST', 'localhost:2000');

  5. Dan Boy
    Member
    Posted 1 year ago #

    I have made that change in the wp-config.php file. Do I need to specifically change what port MySQL is using? How do I find out the port it is using?

    If I tell wordpress that the database is at localhost it ways it cant find it, if I tell wordpress the database is at localhost:1024 IE can't find the page.

    Thanks Daniel.

  6. David Choi
    Member
    Posted 1 year ago #

    Have you cleared IE cache? Changing ports shouldn't be a problem, because I also do it all the time, for security reasons or to bypass block port numbers on the network, never had problems.

    To test if your MySQL port number 1024 really works, try downloading a MySQL client, like (SQLyog free trial):

    http://www.webyog.com/product/sqlyog

    use this to connect to your MySQL server with port 1024. Just trying to rule out the possibilities.

  7. Dan Boy
    Member
    Posted 1 year ago #

    Thanks for your reply. This is odd, the only port it wants to connect to is using port 3306, if I try port 1024 which is what WAMP Server uses (Apache) it won't connect. Does this mean that MySQL IS using the wrong port? And if so, how do I change it?

    Thanks Daniel.

  8. David Choi
    Member
    Posted 1 year ago #

    for changing the mysql port, just change my.ini look for this line

    port=3306

    my.ini is usually located at

    xammp/mysql/bin/my.ini
    C:\MySQL\bin\my.ini

    depending on where you've installed.

  9. Dan Boy
    Member
    Posted 1 year ago #

    OK, I found this section of the my.ini file

    [mysqld]
    port=3306
    #port=1024

    If I change the port to 1024 WAMP Server stays on orange!!??

    Thanks Daniel.

  10. David Choi
    Member
    Posted 1 year ago #

    You probably have to restart the MySQL server. Disregard WAMP, see if using SQLyog you can connect it to the 1024 port. The code should be changed to:

    [mysqld]
    #port=3306
    port=1024

    because # is for commenting out the line, so it will be ignored.

  11. Dan Boy
    Member
    Posted 1 year ago #

    Oh how annoying! It still won't work. WordPress will not see the database.

    Oddly, on my own PC I run WAMP Server and WordPress and MySQL is also set to use port 3306? What's that all about?

    Thanks Daniel.

  12. David Choi
    Member
    Posted 1 year ago #

    Actually this has nothing to do with WordPress. It's more of WAMP problem in your case.

    Might wanna try your luck at

    http://forum.wampserver.com/

  13. Dan Boy
    Member
    Posted 1 year ago #

    I think this IS a WordPress problem. WAMP Server works fine. It's WordPress that won't work with a different port.

    Someone on here must have setup WordPress on a different port than 80.

    Thanks Daniel.

  14. Dan Boy
    Member
    Posted 1 year ago #

    I have been on the WAMP Server forum and they think I am setup OK so why won't WordPress work??? It's very frustrating.

    http://forum.wampserver.com/read.php?2,110838

    Thanks Daniel.

  15. There are 2 separate things in this thread (and really, do not create more duplicates, they'll be deleted on sight):

    A) You want to move mysql's port and use that instance on the new port for the database.

    B) You want to use a different Apache port besides port 80.

    Can you narrow it down to what you want to do? It could be A, B, or both A and B. I think it's just A but I want to be sure.

  16. Dan Boy
    Member
    Posted 1 year ago #

    OK, what I want to do is get WordPress to run on the port that Apache is running 1024. During the setup process I tell WordPress to use localhost:1024 but I cannot find it. If I just tell it localhost it tells me it cannot find the database, that is where the SQL question came from.

    B is what I am trying to do. WAMP server seems to run fine on port 1024 it's WordPress that won't install with this setup.

    Thanks Daniel.

  17. OK, what I want to do is get WordPress to run on the port that Apache is running 1024.

    Okay that's a start.

    First confirm that Apache is working correctly on that port by loading this simple HTML page.

    http://your-intranet-URL-here:1024/readme.html

    If your WordPress installation is installed on the root of that Apache instance running on port 1024 then that will get you the WordPress readme HTML file with "WordPress Version 3.5.1" on top.

    Is that working? That static page has zero dependencies on anything else such as mysql, WordPress, etc.

  18. Dan Boy
    Member
    Posted 1 year ago #

    OK, the browser can't find the read me page on localhost:1024/readme.html

    What does this tell me.

    Thanks Daniel.

  19. Dan Boy
    Member
    Posted 1 year ago #

    If I got to:-

    http://localhost:1024

    I get the WAMP Server page

    Thanks Daniel.

  20. OK, the browser can't find the read me page on localhost:1024/readme.html

    That tells you that the Apache web server running on your PC (it is on your PC right?) doesn't have the WordPress files where you want/meant them to be.

    This is all on localhost meaning your Windows PC? If so have you considered using http://www.instantwp.com/download/ instead?

    InstantWP is just fire and forget and works via http://localhost:4001/

    Yes, it's not port 1024 (which is not a good choice for historical reasons) but it really does just work.

  21. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    I use EasyPHP on port 8080 myself. EasyPHP is really easy to set up and I can have a server installed and WP running in about 30 mins.

  22. Dan Boy
    Member
    Posted 1 year ago #

    Jan, it is actually running on the file server (Windows 2003).

    I have copied the WordPress files to:

    c:\wamp\www\wordpress

    If this the incorrect place to have them? When I did a test run on my PC, which can use port 80, it worked fine so I thought I would just reproduce the installation.

    What is Instant WordPress? Is it a WordPress installation tool?

    Thanks Daniel.

  23. *Jan makes note to play with EasyPHP and thinks he doesn't spend enough time trolling Esmi's site.*

    Jan, it is actually running on the file server (Windows 2003).

    Try http://your-intranet-URL-here:1024/wordpress/readme.html then. Also do you want to use localhost or the server fully qualified domain name?

  24. Dan Boy
    Member
    Posted 1 year ago #

    Tried this:

    http://localhost:1024/wordpress/readme.html

    And I can see the read me, the 5 minute install.

    I would hope that the other PC's can use the Intranet as:

    http://server_address:1024

    Thanks Daniel.

  25. I would hope that the other PC's can use the Intranet as:

    http://server_address:1024

    That's a matter of re-configuring your web server. WordPress doesn't mind where it is located as long as it can be loaded.

    Does http://server_address:1024/wordpress/readme.html work?

    If it does then you can either move the WordPress files into the root from c:\wamp\www\wordpress to c:\wamp\www or reconfiguring your WAMP to use c:\wamp\www\wordpress as it's root.

  26. Dan Boy
    Member
    Posted 1 year ago #

    Does http://server_address:1024/wordpress/readme.html work?

    Yes, that does work but the install still fails.

    Thanks Daniel.

  27. Dan Boy
    Member
    Posted 1 year ago #

    How would I change the WAMP root?

    Thanks Daniel.

  28. I've no idea at all. This is a WordPress support forum. ;)

    Where did you download that WAMP from? This link may have a doc to help you.

    http://forum.wampserver.com/list.php?2

  29. Dan Boy
    Member
    Posted 1 year ago #

    I am certain that this is a WordPress problem and not a WAMP problem. I have installed WAMP and WordPress on may systems but always on port 80. This is the first time I am trying it on a different port.

    I have managed to find out how to change the WAMP root directory and now when I try to run the install I get this message:

    <strong>Can’t select database</strong>
    We were able to connect to the database server (which means your username and password is okay) but not able to select the wordpress database.
    
    Are you sure it exists?
    Does the user Daniel have permission to use the wordpress database?
    On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?
    If you don't know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

    Thanks Daniel.

  30. I am certain that this is a WordPress problem and not a WAMP problem.

    It's a mysql account problem. If the account "Daniel" had the correct permissions then the install script would have created the tables for you.

    Try fixing your Daniel mysql account or create a new mysql user with the correct permissions for that database.

    http://codex.wordpress.org/Installing_WordPress#Using_the_MySQL_Client

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.