Jump to content


  • Posts

  • Joined

  • Last visited

Grabeorama's Achievements


Member (2/7)



  1. Ok problem solved. I think the system was getting confused with file versions used by PHP, as I had 2 different PHP interpreters installed, one from Lampp and one I installed before Lampp. So by uninstalling PHP and adding the Lampp PHP interpreter to the PATH, things started to work correctly again! Thanks for the help, really appreciate it!
  2. Well I have redirected the output to stderr (as mentioned in the OP) and got the following error (only for localhost): php: /opt/lampp/lib/libxml2.so.2: version `LIBXML2_2.9.0' not found (required by php)php: /opt/lampp/lib/libcrypto.so.1.0.0: no version information available (required by php)php: /opt/lampp/lib/libssl.so.1.0.0: no version information available (required by php) But I can't make heads nor tails of it! EDIT:Is it possible that I have multiple versions of the files mentioned in the errors and that PHP is confused as to which to use?
  3. OK I set error reporting to all as you mentioned, and a var_dump on shell_exec is outputting NULL.From command line it all works normally.
  4. How could I print the user of the other file if the shell_exec() isn't running the other file? I've just tried it there, getting this from the command line: php index.php Index: userHello: user sudo -u nobody php index.phpIndex: nobodyHello: nobody but from localhost I only get:Index: nobody as it's not executing the hello file. The same problem for trying to output their working directories. Is there another way I can check?
  5. Hey thanks for the reply, I created two files: index.php: $user = posix_getpwuid(posix_geteuid())['name']; print "Executing as {$user}<br />\n";print shell_exec("php hello.php"); and hello.php print "Hello<br />\n"; Running the index.php from command line works fine, outputting "Executing as <user><br />Hello", as expected php index.php Running the same file from localhost/index.php outputs "Executing as Nobody" as expected, but does not output the shell_exec() command. (Presumably because it's running as Nobody) But then when I run the following command: sudo -u nobody php index.php I get the same output as through localhost, but it does show the output of the shell_exec().Any ideas as to why?
  6. I've been Googling this problem all day now and have nothing to show for it. I'm attempting to run a php script, from a php script using exec. I'm doing this to allow the second php script to run in the background, as it may/may not run for quite some time. This is my code for doing that: exec("php myScript.php > out.txt 2> err.txt &"); With this code I get two new files (as expected) out.txt and err.txt.out.txt is empty, and err.txt contains: php: /opt/lampp/lib/libxml2.so.2: version `LIBXML2_2.9.0' not found (required by php)php: /opt/lampp/lib/libcrypto.so.1.0.0: no version information available (required by php)php: /opt/lampp/lib/libssl.so.1.0.0: no version information available (required by php) I can run the command "php callingScript.php" (the script containing the exec call) from the command line manually, and it works fine. I thought the problem might be related to permissions for the 'nobody' user run by Apache, but when running the command: sudo -u nobody php callingScript.php It works. I've also tried running it with the direct path to php: /usr/bin/php callingScript.php Any ideas as to what's going on ie. why I can run it manually but not via localhost using exec()? And thanks for reading.
  7. Thanks, this is how I used to do it, but it became annoying when moving the project from place to place and having to reconfigure the config file each time. There's no dynamic way of doing it is there?
  8. Grabeorama


    background-attachment: fixed; Source: http://www.w3schools.com/cssref/pr_background-attachment.asp
  9. My project usually has an 'init.php' file in it's root directory which every file includes. This file defines 2 constants: ROOT and PATH:(pseudocode)PATH = dirname( __FILE__)ROOT = substr( PATH, strlen( $_SERVER[ 'DOCUMENT_ROOT'])) this allows me to easily relocate the project to another directory without having to change any code. However, the problem arises when the server has sub domains in it's public_html/htdocs folder.when ROOT should equal '/my/project/', it might equal '/subdomain/my/project/' So my question is:Is there a way of getting the directory my init.php file is in, relative to the DOCUMENT_ROOT which takes into account subdomains?ORIs there a way of having $_SERVER['PHP_SELF'] for included files?
  10. Im displaying an image on a canvas element, but I'd like to rotate the image. I've tried using the context.rotate(angle); but that rotates the canvas element itself, I just want to rotate the image...is there an easy way of doing this?
  11. Grabeorama


    I use this query to group rows in a table by their day in the current year: $date = strtotime(date("M j, H:i:s")); $sql = "SELECT *, DAYOFYEAR(FROM_UNIXTIME(date)) AS mydate , COUNT(FROM_UNIXTIME(date)) AS tot FROM gblog_stats WHERE FROM_UNIXTIME(date) BETWEEN DATE_SUB( FROM_UNIXTIME(". $date .") ,INTERVAL 30 DAY ) AND FROM_UNIXTIME(". $date .") GROUP BY mydate"; The query works perfectly but as an output I may get this:[day of year] - [number of rows]11 - 312 - 815 - 416 - 519 - 3As you can see, the dates that have no row do not display, is there a way in which I could this:[day of year] - [number of rows]11 - 312 - 813 - 014 - 015 - 416 - 517 - 018 - 019 - 3Thanks for any help
  12. Thanks Deirdre's Dad, that fixed the problem. I had this problem before, I keep forgetting about scope.
  13. I'm using the function:function toggle() { this.className = "show"; }and using it as <li onclick="toggle();">, but when I click it, nothing happens...What do you mean by events?
  14. I currently have an un-ordered list with an un-ordered list in it:<ul><li class="hide">2010<ul><li>December</li><li>November</li></ul></li><li>2009</li></ul>What I'd like to do is change the class of the <li> tag from "hide" to "show" when clicked. I've tried changing it using "this.className = 'hide'", but that doesn't seem to work. The other method I thought of was by checking the <li> tag for child elements, and when finding a <ul> tag, it would set it like "ulTag.style.display = 'block';", but I am unsure of how to check the child elements. Any help is appreciated
  15. Thanks, that solved the error, and after a bit more tweaking I got the result I was looking for. Thanks for your help.
  • Create New...