Help with "easy" script install


#1

Hi all…I am trying to get a toplist on my website, so i found a free one that says easy install. Upload the files to your server and type urhost.com/install.php and the rest is cake. I do this but it gives me this error after a while:

Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /home/.gopher/wagerboy/face/topsite/config.php on line 37
Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Everyone I talk to says its your host, is this true? This php script says no need to chmod anything, it runs itself…Its been 5 hours messing with this…Someone please help :slight_smile:

Thanks again…Wagerboy


#2

That error means it is trying to connect to a MySQL database and could not. You probably need to edit the script so that it knows the correct parameters:
database name
hostname
username
password

:cool: [color=#6600CC]Atropos[/color] | openvein.org


#3

Your script does not know how to connect to your database. You have to define, in some way, your MySQL connection details for the script to be able to communicate with your MySQL database. The error message you received indicates that the script does not know about your database.

If you have not already done so, create a database for the script to use from the “Goodies–MySQL” section of the Control panel, and write down or remember the database name, the database username, the database user password, and the host name. You will need this information.

These values need to be defined in some way your script can use in order for the script to work. As I do not have the script, I can’t give you “precise” instructions, but generally speaking running the “urhost.com/install.php” file should give you the opportunity to enter this data.

It is also likely that you can define the variables directly in the config.php file referenced in the error message, though there may be other things that also have to be defined, such as paths, urls, etc., other configuration items (hence the install script).

If this information doesn’t do it for you, post the name of the script and the url where you found it, and I’ll try to take a look later tonight.

–rlparker


#4

Thank you. I am VERY new at this, it was supposed to be just upload and it installs itself. Do I have to do something with DreamHost to make it work? I looked over the install.php and I do not see any code that would look like what you told me. Thanks again


#5

I must have been typing my response when Atropos7 replied, and ourt responses “crossed in the ether”.

If there is nothing in the install script that collects this information, check config.php…you might find it there.
–rlparker


#6

yes sir, I found it, it was indeed in config.php I put in mysql.domain.com, user and pw, saved as text, uploaded, renamed to php file, not it cant find my site…lol…You think this is all I will have to do? You guys are great, thanks again, if theres anything I can do for you, please ask.

Eddie


#7

Eddie,

As I suggested, there might be path, firectory, and/or url related variables also in the config file, which, if present, will have to be properly set for your site to work. CHeck for that, don’t give up, and good luck.

–rlparker


#8

ok got that, went to set up, went to admin and got this:

Warning: require_once(/home/.gopher/wagerboy/face/topsite/tpl/lang/english/lang.php) [function.require-once]: failed to open stream: Permission denied in /home/.gopher/wagerboy/face/topsite/inc/mainfile.php on line 169

Fatal error: require_once() [function.require]: Failed opening required ‘/home/.gopher/wagerboy/face/topsite/tpl/lang/english/lang.php’ (include_path=’.:/usr/local/php5/lib/php’) in /home/.gopher/wagerboy/face/topsite/inc/mainfile.php on line 169

i chmodd’ed everything they told me, and this is what I am getting now…Any ideas? I just cant do this stuff…lol…its driving me nuts


#9

OK…Got that last one now, any idea what this means? I cant figure it out(surprise)

Application Warning error :: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
[File /home/.gopher/wagerboy/face/topsite/inc/class/db/class.db.mysql.php (Line 29)]

Database Fatal error :: Connection to host attempt failed
[2002 : Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)]


#10

Congrats on working out the permission bit. Good Job! Wagerboy, take a close read of that “Application Warning” message, and compare it to the first error message you posted about. The new message is telling you the same thing that the first error message you wrote about in your original post told you:

The program can’t connect to your database.

I know you entered the requested data into the config.php you mentioned the script using, and you got past that point. Now, another place in the script cannot properly connect to the database. This makes me suspects you might have some paths “borked”, or some other incomplete installation/configuration step or variable, as the part of the code that is trying to connect to the database now fails at a different (this) point.

Really, at this point carefully reviewing all the config options,browsing through the code at around the point where the error occurred, and double-checking to make sure that all the “includes” the program requires actually got included are about the only suggestions I can make.

One last thing:You have not indicated what version of PHP you are running. If you are running PHP5, it is possible that the program was written for PHP4, which handles passed variable differently than PHP5. If you are sure all your configs, etc. are correct, you might try resetting your webspace to use PHP4 and trying again. This might be particularly indicated if the script is older, which might suggest it was written for PHP4. Again, without seeing the code for the script(s), it is really hard to be more specific.

Have you checked in with others using the script via the author’s, or other, forum and asked those who have actually used the script what the problem might be?

You could point me to the script and, as I said, I’ll try to give it a run on Dreamhost later in the evening when/if I can find time. Without seeing the code, I am only guessing from my experience what the problem(s) might be (though it appears you are making progress!)

Don’t give up. When testing modified scripts, make sure you clear your caches (and sometimes session/cookies), and reload the impacted urls so you are sure you are seeing the full effect of your changes. Good Luck!

–rlparker


#11

wow your a great guy for helping me, thank you so much…See the problem is, I dont know PHP at ALL…I dont know anything about any programming, code or even html for that matter…lol

That other script I first started with annoyed me to death, so I found another one, and that what I was playing with and such…I edited the config file to host name and user/pw(like a champ ;)) and then came to the missing directory(it was a blank directory for some reason? I uploaded those files again, and then this happened.

I looked thro the file that the string was saying on the error, but I have NO idea what im looking at at this point so Im afraid to change it. I just dont see where it could be. I do however see that its pulled from the “index.php” file, and for some readon I cant edit that, it is blank when I d/l it. I dont have a ftp editor, I must d/l it first.

Do you have icq or aim or anything? I’d love to chat with ya, and I really do appreciate all your help…The replies I have gotton have been “stay off the internet”, "goto your day job, etc…Its 130am here but I cant goto bed til I figure this out, or kick that cat, I havent decided :slight_smile:

This is the script

http://www.phpfaber.com/i/products/topsites/

Eddie


#12

I think Im close…Ive edited many files, now I get this and cant figure it out, or what it means??

Database Fatal error :: Var select failed
SELECT email FROM admin LIMIT 1
[1146 : Table ‘topsite.admin’ doesn’t exist]


#13

Wagerboy,

Attempting this might be a bit above your head if you honestly know nothing about PHP, Your comment in your previous post about index.php leaves me at a bit of a loss to try to explain to you what is involved in setting up a script like this. It is relatively easy, but that presumes you understand how scripts work in a web hosting environment. and you may need to do some more reading before you will really understand it.

Don’t just start editing files without understanding what you are doing, or you will get the thing totally FUBAR. Just hold on and let me take a look at it. I have grabbed the script, and am going to take a few minutes bnow to install it myself and see what is involved.

In the meantime, so this doesn’t get to be a major project quit editing files and please gather the following information for me and respond to me with a post stating:

  1. The url you are trying to install this script on (your domain)
  1. What version of PHP you are running (available from the control panel.

I will try to set the script up on one of my test sites, and we will see if it reasonable for me to try and talk you through installing this.

Regards,
rlparker.


#14

Im sorry…Yes I have no knowledge of programming at all…According to the panel, its php 5.1.2

Site is facef**ckers.net (adult name, I dont want to offend anyone, you see what the stars are…

I only edited where it said too, like hostname, user/pw and email, I didnt change anything really, just that stuff.

I cant thank you enough, you really are a true help and generous.

I dont get this message, there is no “email” script from the admin directory.

Database Fatal error :: Var select failed
SELECT email FROM admin LIMIT 1
[1146 : Table ‘topsite.admin’ doesn’t exist]

Thanks again, Eddie


#15

Eddie,

Okay. I downloaded the program, installed it on Dreamhost, and checked it out. The whole install process took about 3 minutes (I already had a database setup, so I didn’t have to wait for hostname to propagate). An important note here is that I was running the test installation under PHP4.

A number of points are worth mentioning here.

  1. The installation is completely straight-forward if you RTFM - Check out the “readme.txt” file in the .zip

  2. Although the program itself is GNU/GPL, the authors provide installation services for $9.95 (which seems more than reasonable - though you really should not need that)

  3. To use this program with any degree of success in customizing the output, you will need a reasonable understanding of HTML, as there is no WYSIWYG editor, and all the “editing” is done in text input boxes. In other words, you could make a real mess of things if you don’t know what you are doing.

  4. The “demo” running on the author’s site is running PHP4. While I have not gone through all the code, it appears to me that you will need to do some extensive recoding to get it to work under PHP5, due to the way variables are handled. Alternately, you could reset your webspace to use PHP4.

  5. The permissions the program instructs you to use are unsafe and I strongly recommend that you do not run this program configured as instructed. The install program directs you to change several directories to “777” and instructs you to set you config.ini.php to “666”. As Dreamhost runs PHP-CGI as your user, you can probably set the permissions more restrictively (755 for directories and 644 for files) without problems (my initial “quick test” worked, but I did not test extensively) but YMMV.

  6. It appears that, in addition to setup/config issues, and the PHP4/5 issue, youo have not managed to sucessfully upload all the files and folders that are a part of the program. All the “debugging” ion the world will just leave you frustrated trying to get a system of this size to work without all the files reliably in place. You did not indicate what ftp client you are using, but other users have expressed difficulty withy partial file transfers with certain software. If you elect to “unzip” the package on your computer, and try to ftp all the files/folder to your webspace, you have to get all the files, and *all the files must transfer completely and in the proper “mode”. Otherwise, you will never get this running.

I think you should understand something here. While I am more than happy to “point you in the right direction”, and give you *specific" help if I can, I can not undertake here to teach you all the things you will need to understand to run this script responsibly. You need to take it upon yourself to “google” a bit and learn at least a little about PHP, MySQL, and webspace /server administration in order to be a responsible user of a shared hosting system. Enough of the lecture, here is how to install the script on Dreamhost:

*** IMPORTANT POINT NUMBER 1***

First of all: Delete all the files and folders created by your previous “borked” install attempts - This is important. You can do it with the shell if you know how, or use your ftp program if necessary, but it needs to be done.


Note: I’m going to describe how to do this the “easy way”, in hopes of encouraging you to research further the tools used here.


Now:

  1. Set your webspace to use PHP4 via the Manage Domains section of the DH Control Panel.

  2. If you have not already done so, create a MySQL database for the program to use (using the DH panel), and record the host name, user name, user password, and database name as described earlier in this thread. If you already have that info from your “borked” install, that will work.

  3. Log into your shell account using ssh or telnet

  4. Navigate to your publicly accessable webspace using cd (in the examples that follow, (enter) is not to be typed, it means “hit the ‘enter’ key”):

cd yourdomain.com (enter)

  1. Create a directory for your topsites program (name it whatever you want - I’ll use “topsites” for the examples) using mkdir:

mkdir topsites (enter)

  1. navigate to the direcorty you just created using cd:

cd topsites (enter)

  1. Get a fresh copy of the “zip” archive for installation using wget:

wget http://www.phpfaber.com/cms_content/files/phpfaber_topsites.zip(enter)

** note that this should be all on one line with a space between the wget and the url - the forum bungles this sometimes)

  1. you will now have a file named “phpfaber_topsites.zip” in your directory, and you will need to “unzip” it:

unzip phpfaber_topsites.zip(enter)

**Unzip will extract the files from the archive and place them in the appropriate directories. Just set back and watch.

  1. Navigate in your web browser to “http://www.yourdomain.com/topsites”. This will cause the install.php program to run.

  2. Complete the form presented by the installer with the information you previously collected about your database.

  3. Follow the rest of the instructions in the install. I recommend, however, that you set the permissions they tell you to set to “777” to “755” and what they recommend setting as “666” to “644”. This seemed to work fine in my 30 minites or so of playing with the program, but if problems later develope you can tweak the permissions as necessary.

  4. Enjoy learning enough HTML to customize the site contents and templates.

you are done.

You can accomplish the zip file transfer and unpacking with by transferring the “zip” file to the appropriate directory on the server, and unzipping from there, or ftping everything already extracted into folder on your own computer if you really don’t want to use the shell, but you will have to make sure everything makes it intact and in the proper place (and transferred in the correct ftp "mode!) for it to work. Try it my way, you’ll be glad you did and hopefully it will encourage you to learn a bit about using the shell.

–rlparker


#16

Thank you so much for your help. I have installed the script and it seems to be ugly. Like you said though, no way I can change templates, I have no clue what im looking at. I did change some images to my own though.

I really would like to thank you, you went way above what a message board “techy” would. Give me your paypal address and i’ll send you some money. How long did it take you to learn php and this kind of stuff? It interests me, i’d like to learn. If you need anything, please feel free to email me, wagerboy@gmail.com…I am in the finance/automobile business and if i can help I’ll try. Im in the NYC burb’s…Thank you again.

Eddie


#17

Eddie,

Congratulations on a sucessfull install! I’m glad I was able to help you get the thing to work, even if you elect not to use it :wink: As for it being “ugly”, I remember something my father (who was an architect) said to me when I was a young boy after I commented on how “ugly” a particular building was as we were driving past: “Son, someone, somewhere is very proud of that building, or they wouldn’t have built it.”

I did not mean for my earlier comments to discourage you from learning enough HTML to “beautify” the output of the program. There are enough different templates in the installation for you to very much change the look to something you like if you want to play with it.

I was happy to help, and while I appreciate your offer to send some money via PayPal, that is not at all necessary; I would prefer that you “pay it forward” by helping others as much as you can when the opportunity presents itself (and/or, make a contribution to epic.org on my behalf -grin).

As for the learning process, it is a continual thing. I do not consider myself to know PHP, though by reading I manage to accomplish most of what I need to be able to do to “get by”. The great thing about the web is that everything you need to acquire skills in these areas is “out there”; you just need to reserve some time and go after it.

Good luck as you continue to expand your skill set and, most of all, “enjoy the process.”

–rlparker