Bitcoin Forum
May 07, 2024, 06:40:07 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Where to Start? PHP + BitCoin  (Read 1918 times)
philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 14, 2011, 06:30:11 PM
 #1

I'm a PHP developer(1 year experience) looking to learn how to work with BitCoin.

I don't have that much experience with APIs.

Any suggestions appreciated.
In order to get the maximum amount of activity points possible, you just need to post once per day on average. Skipping days is OK as long as you maintain the average.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 14, 2011, 06:55:33 PM
 #2

Google bitcoin-php, and then ask any questions you have about it.  I have a decent amount of experience with the library now.
philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 14, 2011, 07:36:51 PM
 #3

I'm taking a look the following post

http://forum.bitcoin.org/index.php?topic=9304.0

Can you explain the following variables

Code:
$rpcUser = "username";
$rpcPass = "password";
$url = "http://localhost:8332";

Do you set this up to access an online BitCoin Client? Existing at what ever url you choose?
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 14, 2011, 08:23:57 PM
 #4

I'm taking a look the following post

http://forum.bitcoin.org/index.php?topic=9304.0

Can you explain the following variables

Code:
$rpcUser = "username";
$rpcPass = "password";
$url = "http://localhost:8332";

Do you set this up to access an online BitCoin Client? Existing at what ever url you choose?
Close, but no.  You have to have a bitcoind instance running.  Go to bitcoin.org, and download the client for whatever OS you are using.  Inside one of the subfolders, you'll find bitcoind.  In the same folder as bitcoind, you need to create a file called bitcoin.conf, and in it place:

rpcuser=user
rpcpassword=password

Also, to allow external access via PHP, you'll have to add the IP address of the PHP server (wildcard * allowed).  If bitcoind is running on your PHP server, you shouldn't have to do anything (as 127.0.0.1 is allowed by default).

rpcallowip=1.1.1.1

Then, in your PHP file, change "username" and "password" to whatever un/pw you wrote in the .conf.  Leave $url alone if bitcoind is running on your PHP server, or change the localhost to your external bitcoind IP.  Start up bitcoind, then you should be able to connect to it via PHP.
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
July 15, 2011, 10:43:49 AM
 #5

I'm a PHP developer(1 year experience) looking to learn how to work with BitCoin.

I don't have that much experience with APIs.

Any suggestions appreciated.

For reference:
 - http://en.bitcoin.it/wiki/PHP_developer_intro

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 19, 2011, 03:06:53 PM
 #6

Still having problems right for the starts.

I have the bitcoin application running.

Then I go to terminal and input

Quote
./bitcoind

No such file or directory
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 19, 2011, 03:09:45 PM
 #7

Still having problems right for the starts.

I have the bitcoin application running.

Then I go to terminal and input

Quote
./bitcoind

No such file or directory

If you already have it running, why are you trying to start it again?
philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 19, 2011, 03:13:45 PM
 #8

I am just trying to follow the instructions but I have tried it running and not running.

Same results.
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 19, 2011, 04:07:11 PM
 #9

If you were on windows, I could tell you exactly what to do... but I'll try to explain what needs to be done on linux.

You need to run the GUI client with the -server switch OR run bitcoind.  They both do the same thing.  I liked to run the GUI while I was developing, because I could easily see the transactions I was making in realtime.

If you want to run bitcoind from the terminal, instead of the GUI client with the -server switch, then you'll have to navigate to the directory where bitcoind is stored.  It should be /yourbitcoindirectory/bin/32, if I remember correctly.
philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 19, 2011, 05:04:56 PM
 #10

On a Mac.

Library/Application Support/Bitcoin

Quote
__db.001   __db.004   addr.dat   blkindex.dat   debug.log
__db.002   __db.005   bitcoin.conf   database   wallet.dat
__db.003   __db.006   blk0001.dat   db.log
Philip-Kirkbrides-MacBook-Pro:Bitcoin philipkirkbride$

Doesn't seem to be a 'bitcoind' file anywhere on my computer. Have tried running the app and don't see any options or switches to do with server interaction.

Any ideas?
SgtSpike
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 19, 2011, 05:14:34 PM
 #11

Ah, sorry, I thought you were on linux.  I'm even more unfamiliar with a Mac.

A switch, at least on Windows, is where you add "-server" after the target path in the shortcut properties.  I have no idea what the equivalent is on a mac, or how to use it.  Someone else will have to jump in here...
pent
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
July 19, 2011, 07:48:26 PM
 #12

Still having problems right for the starts.

I have the bitcoin application running.

Then I go to terminal and input

Quote
./bitcoind

No such file or directory


Is there any file named 'bitcoind' in a current directory? ))

You have to change directory where bitcoind is located first.

not familiar with mac's too... but it is a general unix command

"./somescript" = run a somescript, located in current dir.
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
July 19, 2011, 10:42:25 PM
 #13

Still having problems right for the starts.

I have the bitcoin application running.

Then I go to terminal and input

Quote
./bitcoind

No such file or directory

Provide the full path to wherever you installed bitcoind.

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 20, 2011, 12:36:36 AM
 #14

I have looked in all bitcoin related folders. As well as a system wide search for "bitcoind".

It doesn't exist on the computer.
philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 20, 2011, 12:50:26 AM
 #15

I will make another thread titled "How to Use BitCoin on local server with Mac OSX".

But in this thread lets move on. If I can't play around with BitCoin on my local server what about installing it on my live server?

I use GoDaddy Embarrassed and usually only interact via FTP & MySQL.
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
July 20, 2011, 01:26:07 AM
 #16

I have looked in all bitcoin related folders. As well as a system wide search for "bitcoind".

It doesn't exist on the computer.

Very strange. Did you use the official Mac OS X build or did you build it yourself?

I will make another thread titled "How to Use BitCoin on local server with Mac OSX".

But in this thread lets move on. If I can't play around with BitCoin on my local server what about installing it on my live server?

I use GoDaddy Embarrassed and usually only interact via FTP & MySQL.

Shared hosting providers rarely permit running background processes. GoDaddy is no exception. Now if you have a VPS or a dedicated server, you are fine and you can run pretty much whatever you want.

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 20, 2011, 02:03:35 AM
 #17

Using "bitcoin-v0.3.23".

I have Grid Hosting with GoDaddy. Its suppost to let you run Rails Apps which isn't standard with the lower end hosting.

Assuming I have a hosting service that will let me run a process. Do I just upload a folder and run a script?
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
July 20, 2011, 02:12:56 AM
 #18

Using "bitcoin-v0.3.23".

Did you use the official Mac OS X build or did you build it yourself?

I have Grid Hosting with GoDaddy. Its suppost to let you run Rails Apps which isn't standard with the lower end hosting.

Assuming I have a hosting service that will let me run a process. Do I just upload a folder and run a script?

Is that what they call "4GH" now? If so, then bitcoind is still not permitted.

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
philipk (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 20, 2011, 01:01:43 PM
 #19

Yes its the official build.

As for hosting your probably right.

'Hosting - Web - Deluxe - Linux - 1 year (recurring)'

I still want to know what service I need to run Bitcoin on server. I have had good luck calling them in the past for upgrades. 
Xenland
Legendary
*
Offline Offline

Activity: 980
Merit: 1003


I'm not just any shaman, I'm a Sha256man


View Profile
July 24, 2011, 06:14:37 AM
 #20

Yes its the official build.

As for hosting your probably right.

'Hosting - Web - Deluxe - Linux - 1 year (recurring)'

I still want to know what service I need to run Bitcoin on server. I have had good luck calling them in the past for upgrades. 

You need Root Access to a hosting server, usually Virtual Private Server hosting or Dedicated Hosting comes standard with this... I don't know why you can't find the bitcoin application but you will need Root Access enabled on your hosting in order to run basically anything bitcoin related.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!