Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. Perfect, thanks for all the advice. It's greatly appreciated, thanks again.
  2. Wait, that's why I got it working the way I wanted. I have one more question then I can close this topic down (with a wealth of knowledge from it). #! /usr/local/bin/php5 I added that to the top outside of the php tags, at the very top. I tried it without it and then with it only #! path worked. It doesn't work without the #!. Why is that, so anytime I ever run a command inside the php, python, or perl file itself then I need to have the #! at the beginning. (Is that what tells command line to pick up what is after that as a "command".
  3. Ok, thanks for clearing that up. The other thing I was wondering is what thorpe referred to as a "shebang". Is there a way for me to pass that at the top of the php, python, or perl script so it is automatically ran as that. I tried putting. /usr/local/bin/php5 as an echod out command in php, but it's not doing anything but showing it to the screen. The problem is, that is what I am using to run the file. /usr/local/bin/php5 createAndModify.php that is exactly what I ran, and it worked. However in the end, I want to see if I can get the /usr/local/bin/php5 part to be in the script in the beginning so all I have to do from command line is createAndModify.php and it'll do the same thing. Basically the reason is. After I get the command line memorized some, then I am going to create a few "test" applications and try to have some of those command line files that run through the browser. I have seen some you can create command line file's, that automatically connect to SSH and run all necessary commands. I am also going to be create other files. Python, perl, php 3, php 4, and php 5. I don't want to have to specify them all as I type them, I wanted to put something at the top of the page, so in command line it can already tell what to run them as. I guess this is where that shebang would come in, how do I utilize that where it will work.
  4. Ah, man php But in essence I never have a reason to run the php command, since he showed me how to do it the other way as ./filename.ext so.. I don't really ever have a need for php, I was just using it because a friend showed me that to run a php file. Yes, there is no error as far as that's concerned. However I do have another information request. I ran this inside the command line. u43118491:~/#####/wiki/maintenance > /usr/local/bin/php5 . /createAndPromote.php X-Powered-By: PHP/5.2.1 Content-type: text/html Since I am on a learning binge today I wanted to ask a few questions. 1. Is this the same thing when running python/perl files. I just specific the directory of the processor, then the filename like this. 2. I know this is a great method, and I am so thankful for it working. However is there an alternative. Like can I somehow pass that "directory" into the php/python/perl file itself. SO it'll tell "whatever" server it's using to run that directory. or do I ALWAYS have to specify taht directory. I was hoping if I could put that within the php file itself, it would automatically get picked up as being like that. IS this possible, or do I always need to do it this way.
  5. WAIT... I understand now. When I execute a file, I don't really need php -f file.ext I can actually specific 2 parameters. The first is what to use to run the file, the second is the file name, or path to file name. So below, I put down the location of the php5 module. Then space Then the filename, and it ran. This time it gave me a different error. u43118491:~/####/wiki/maintenance > /usr/local/bin/php5 . /createAndPromote.php X-Powered-By: PHP/5.2.1 Content-type: text/html Please provide a username and password for the new account. u43118491:~/####/wiki/maintenance > businessman So a google (troubleshooting) method is always. use which to test what versions of php there are on the server and where. Then I can use that, to run the file through that in all situations. Now was that error related to something else still related to command line, or something to do with the script I am installing. Thanks.
  6. Ok, here is a log of what I "ran" through command line. after I had the shebang at the top u43118491:~/#######/wiki/maintenance > php -f createAndPromote.php #! /usr/bin/.php5Sorry! This version of MediaWiki requires PHP 5; you are running 4.4.4. If you are sure you already have PHP 5 installed, it may be installed in a different path from PHP 4. Check with your system administrator. u43118491:~/#######/wiki/maintenance > php -f createAndPromote.php Sorry! This version of MediaWiki requires PHP 5; you are running 4.4.4. If you are sure you already have PHP 5 installed, it may be installed in a different path from PHP 4. Check with your system administrator. u43118491:~/#######/wiki/maintenance > chmod +x createAndModify.php chmod: getting attributes of `createAndModify.php': No such file or directory u43118491:~/#######/wiki/maintenance > chmod +x createAndPromote.php u43118491:~/#######/wiki/maintenance > ./createAndPromote.php X-Powered-By: PHP/5.2.1 Content-type: text/html Please provide a username and password for the new account. u43118491:~/#######/wiki/maintenance > those are the commands/information I ran through command line recently.
  7. Not sure where to add the "shebang" but I did this #! /usr/local/bin/php5 at the top of php before the opening tags, and inside php trying to echo it (both). Now I went into command line and tried running it again, and same message.
  8. I now understand that the top part is a shebang as "thorpe" told me. But I don't understand how to use it. I also understand the hello world (I guess to test it). Make executable I have no idea. I know chmod but never saw +x The way you showed me to execute doesn't execute. Do I run these through command line, I was able to follow so far, but now I am complete lost, and I saw that same thing to within the 1and1.com faq but it made no sense to me.
  9. First I really want to thank you for filling me in on this man command. This seems very helpful, I also learnt that q backs out of something (like when your in the man command). Another thing I was wondering, when I try to do something like man -f which "-f" being what I used to try to run the file in the first place, it doesn't work. It works with ls though, which was VERY informational, thanks again. Second Based on what you said, I ran a little test. I was told there server supports php 3, 4, and 5. I also know 6 doesn't exist. So I ran the following commands (in code) and got there output (in quotes) PHP which php PHP3 which php3 php4 which php4 php5 which php5 php6 (testing to see if it would come up with an error if something didn't exist) which php6 This tells me for a fact they have the php3, 4, and 5. So what can I do "with" this information to get it to do what I need.
  10. Wait, yeah maybe that will help. WHen I am trying to run the file, I get into the directory and run. php -f createAndPromote.php When I do that, I am getting this message. Does that mean there is someway for me to change the path. I could call them again, but it sounds like I know more about what I am doing now than they do. They have non-technical people in tech support.
  11. I know, I meant I am trying to get this thing down so I can get this script installed (hopefully gaining the knowledge on how to switch between php versions for command line), before I start trying to setup where it can run python and perl files on the web. i want to get where I can easily change between php 3,4, and 5. I am trying to get this one thing working, then I was going to perform some personal analysis tests on the differences between 3, 4, and 5 (which is why I was hoping I could change through them in the Command line like I could through the browser), but I am starting to wonder that won't happen because of there stupid setup.
  12. Damn. I really, REALLY wanted to thank you. That cleared up about 20-30 "uncertanties" I had with some of those languages. That really helps put a lot of things into perspective. Thanks for clearing that up. I learnt a lot in this post even though it wasn't mine, thanks a lot. I am bowwing out now, so you can continue your discussion, good luck with your issue.
  13. Another thing is they claim I can use php3, php4, php5, python and perl. Lately I have been learning python, and I am about to start playing with perl in my spare time. I tried a line of code they showed as http://faq.1and1.com/scripting_languages_supported/cgi/1.html Right there, basically. So I ended up trying: #! /usr/bin/php5 and still nothing. I tried making this a comment, and echoing it both within the createAndPromote.php but it still returns the same error, and just executes that command as text. I will be trying to get .py and .perl files to work after that, but I cant' do that if I can't even get it to use the php5 files. They kept telling me to name my files .php5 and it would work through command line, they also told me that bullshit about htaccess. After wasting hours this morning I realized how stupid they really where.
  14. Oh. I installed a wiki (www.mediawiki.com or google "Media Wiki".) I have gotten the whole thing installed and running and it requires php5. Through the browser everything worked out. However for some reason it didn't create my actual admin account. It created my user, but not my admin, so I saw on the site where it says it sometimes doesn't do this for unknown reasons and provided a manuial fix. So I took AdminSettings.php and recreate it as they listed in the manual. Then I went to run /wiki/maintenance/createAndPromote.php which requires php5 and it requires being run on the command line as well. It has an include for something called commandline.inc Either way that's the reason I was trying to do something. In the end I have learnt a lot but it's starting to look like I won't accomplish my initial goal. I don't have admin access to any of the "maintenance" tasks in the wiki because of this. The reason I know it's a PHP 5 issue is because there is a piece of code within the commandline.inc for that file that reads <?php /** * @todo document * @addtogroup Maintenance */ $wgRequestTime = microtime(true); /** */ # Abort if called from a web server if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { print "This script must be run from the command line\n"; exit(); } if( version_compare( PHP_VERSION, '5.0.0' ) < 0 ) { print "Sorry! This version of MediaWiki requires PHP 5; you are running " . PHP_VERSION . ".\n\n" . "If you are sure you already have PHP 5 installed, it may be " . "installed\n" . "in a different path from PHP 4. Check with your system administrator.\n"; die( -1 ); } (it's an inc file without <?php tags hence the no syntax highlighting) That check there tests to see if it's command line, then checks the version. I keep getting returned that error message. Telling me I am trying to use php version 4.4.4. and it requires 5.
  15. I tried entering it exactly as you mentioned, as well off numerous various. IN the end I get the same messages about directory not existing, and when I type it "word-for-word" like you said it returns.
  16. First So "whereis" is another command. It's basically whereis filename.ext and it will basically report where the file is located... Second When I run "whereis" on any filename other than the php that you showed me, all it does it redisplay the name of what I just added. However this is something I Can find out by google, so in essence just thanks for telling me about this. Third The output of the command you told me to execute was Again, thank you so much for walking me through parts of this. This is something I was doing partially for a personal project, and partially to learn, and I have learnt a lot during this process, so thanks again.
  17. Email them with something like "Can you send me a list of some site's you have hosted on your server from some of your clients. I am wanting to get a feel for the speed/availability/quality of you (as a hosting company) and I think that would be the best way for me to do that. Thank you."
  18. Wait, THAT'S why I have heard bad things about C#. So basically C+ (the language php was written in and how you build it's extensions) was something that is used differently. The C# language is the one that really isn't as powerful as C+, it's not been out as long, and it's owned by Microsoft, so you also have to go through the burden of having ASP. (I am not trying to take over this post, just contributing what I just thought of), some very interesting thoughts in this specific post. As far as web programing (to the original poster) wouldn't you rather use C+ instead of c# to do that, because you don't have the same restrictions. THe CMS someone told me they created that was in C+ as opposed to C#, I had them confused. Very interesting stuff.
  19. Not only am I doing this but I am trying to learn from it as much as possible. First $ ls -l /usr/bin | grep php Ok, I understand what ls is, (it shows the directory). What is -l I don't understand that, or anything after that. (Just for learning purposes). Second The output that the command you gave me outputs is. That is what shows up. After speaking with the host a few time's, they have mentioned they have support for php 3, 4, and 5. after htaccess editing I can change them around in there, but they keep saying I can do it through command line on either php3, php4, php5, python, or perl. So I know there has to be a way, they are just dumb. They keep telling me htaccess should do that, so they are dumb.
  20. Now that sucks. How do I go about getting access to them through command line, or is this something that won't be happening.
  21. So that's what I was basing it off of. I know php can also output other languages (I know this for a fact), because it can pass through PHP to parse C# (what I read.) Ah forget it, not ready to get into c# yet, have fun.
  22. I am assuming that $ is basically symbollic for (that is where you put the command), because I see nothing like that, and it works when I don't put it (unless it has a use I am unaware of.) When I put that in I get the following output I understand it is "by default" running off of PHP 4, but it's the same thing. When I called the host and spoke with them about it, they had originally told me to add something in htaccess to get php 5 working through the browser, which was. AddType x-mapp-php5 .php Now when I called they told me to add this to get it working in command line. AddHandler x-mapp-php5 .php I tried that and it didn't work, so I even tried to change the filename to php5. I have nothing else to try, I even found another tutorial on it, about adding something at the top of the php file in the form of a bash command, but I don't know how to do that.
  23. www.1and1.com Developer Package I have tried everything. I tried even temporarily changing the file to .php5 and it didn't run that way either. I even tried finding commands for shell that will specifically "force" it to parse them AS php5.
  24. Server Info Linux PHP Version 5+ & 4.4.4 Both on the server Problem - I have added something into htaccess that forces all files to run in the php 5 parser when going through the browser. However now when I try running the PHP files through Shell it is telling me I have an improper version of PHP (so basically the script I am using requires PHP 5, and because of that, I can tell it's still trying to read it as PHP 4, is there a way to run it through php 5 parser specifically.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.