Jump to content

Tonic-_-

Members
  • Posts

    108
  • Joined

  • Last visited

    Never

Everything posted by Tonic-_-

  1. Hello, It's been awhile since i've used Nginx and a website that I am running on the server uses include_once to include the header, sidebar and footer. The problem is they don't actually load under Nginx and was wondering if anyone else encountered this and knows how to solve this? Nothing logs into the php error log related to it. Here is the conf file. server { listen 80; server_name _; #charset koi8-r; access_log /home/web/logs/host.access.log main; location / { root /home/web/public_html; index index.php index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { access_log off; expires 30d; root /home/web/public_html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass 127.0.0.1:9000; fastcgi_param PHP_VALUE "error_log=/home/web/logs/php.error.log"; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/web/public_html$fastcgi_script_name; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 50; fastcgi_read_timeout 50; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } }
  2. It returns 76561198509709728 when it was suppose to return 76561198509709722 only the last digit is incorrect :3, tested it on a few other strings and it seems to only be off by a few, but the amount it's off by is not always the same.
  3. Ahh, I kind of thought it may have to be with the servers OS, I went from a 64-bit OS to a 32-bit OS. I tried what you said, sadly it didn't return exactly what I wanted. Suppose I'll just have to reload it with 64-bit again or maybe make a API on a 64-bit OS to call it, thanks anyways :3
  4. Hmm... Alright, I did this a few months ago, I reloaded the OS on my VPS and now I'm getting issues. I'm converting a value like 110000120bfd99a from hex to decimal, it's suppose to return 76561198509709722, but instead, it's returning 7.656119850971E+16 Any ideas how to fix this? It's really starting to annoy me.. I use hexdec($value); Like I said, it worked before I reloaded my OS now it just won't work :\
  5. That coding will work, the issue may be that GD Lib is not installed on the system with freetype. make a test page with <?php phpinfo(); ?> and scroll through it to double check all the PHP modules that are installed on the system and make sure GD is on the list.
  6. Tried browsing the web and didn't find much but what's an effective way to execute shell commands as root through php, I know there's exec but I couldn't get it to work the last time I tried.
  7. Try going into your php.ini file (PHP configuration) and find the line memory_limit and try to raise it to maybe 15M or something? Something a bit higher then whatever the default value may be. I noticed this is a SMF related file so it's safe to assume that this is just a PHP configuration thing that needs to be bumped up a bit more.
  8. Didn't feel right not testing and this will work. <?php $txtfile = "/path/to/file/name.txt"; $handle = fopen($txtfile, "r"); $data = fread($handle, filesize($txtfile)); preg_match_all("/token (.*): (.*?)\n/", $data, $return); foreach($return['1'] as $key=>$value) { echo "Token: " . $return['1'][$key] . "<br />Runtime: " . $return['2'][$key] . "<br /><br />"; } ?>
  9. Maybe... <?php $txtfile = "/path/to/file/name.txt"; $data = fopen($txtfile, "r"); preg_match_all("/runtime (ms) for token (.*?): (.*?)/", $data, $return); $array[token] = $return['1']['0']; $array[runtime] = $return['1']['1']; foreach($array as $var) { echo "Token: " . $var['token'] . "<br />Runtime: " . $var['runtime'] . "<br /><br />"; } fclose($data); ?>
  10. You can use either: while ($row = mysql_fetch_assoc($result)) { $array[id] = $row['gameid']; $array[title] = $row['gametitle']; $array[cover] = $row['cover']; echo "<div class=\"noticia\">$array['title']</div>"; } or while ($row = mysql_fetch_assoc($result)) { $array[id][] = $row['gameid']; $array[title][] = $row['gametitle']; $array[cover][] = $row['cover']; } foreach($array as $key=>$value) { echo "<div class=\"noticia\">$array['title'][$key]<div> }
  11. Could be a problem I did somewhere if you used the while statement instead of for, to confirm this use your original code with the <?php }}?> fix and the echo, if it still does it then it can be the SQL Query statement or somewhere else in the code. I'm not all to familiar with using mysql_query or mysql_fetch_assoc as I use a different connector. Or maybe changing this coding if($nuser){ $userfinal=$nuser; }elseif($auser){ $userfinal=$auser; } to if(!empty($nuser)){ $userfinal=$nuser; }elseif(!empty($auser)){ $userfinal=$auser; } else { echo "No sessions found"; }
  12. To me this sounds like a permissions problem or a misconfiguration in PHP. If you are running this on a linux box try chmodding the file to 0750 (750 via FTP)
  13. I see the problem now, I didn't see notice the if statement above the $members query. Above </table> change it to <?php } } ?> You are not closing if(isset($userfinal)){
  14. Well the syntax fix that I posted automatically echo's the $title variable, I was just suggesting if you don't want to echo / print that result within the while statement that you should load each game into a array and $array[xxxx][] can do it. Hope you get it working though
  15. I suggest fixing this: echo '<td><a href="member_profile.php?username=' . $name['user'] . '">' . $name['user'] . '</a></td>'; Maybe changing it to echo "<td><a href=\"member_profile.php?user=" . $name['user'] . "\">" . $name['user'] . "</a></td>"; Another suggestion is to use a while loop instead of for. <?php session_start(); require 'database.php'; $nuser=$_SESSION['user']; $auser=$_SESSION['admin']; if($nuser){ $userfinal=$nuser; }elseif($auser){ $userfinal=$auser; } if(isset($userfinal)){ $Members = mysql_query("SELECT user FROM characters WHERE level ='1' ORDER BY exp DESC") or die(mysql_error()); ?> <table border="0"> <?php while($name = mysql_fetch_assoc($Members)) { ?> <tr> <?php echo "<td><a href=\"member_profile.php?user=" . $name['user'] . "\">" . $name['user'] . "</a></td>"; ?> </tr> <?php } ?> </table> Either way it should work.
  16. $result = mysql_query("SELECT * FROM xbox_games order by gameid"); while ($row = mysql_fetch_assoc($result)) { $id = $row["gameid"]; $title = $row["gametitle"]; $cover = $row["cover"]; echo $title . "<br />"; } Not suppose to add ; next to while() Another thing don't forget if you're not printing the data within the while statement you will keep overwriting the $id, $title, and $cover variable. So if you just want to build an array list first then I suggest to load those into an array like $array = array(); $array[id] = $row['gameid']; $array[title] = $row['gametitle']; $array[cover] = $row['cover'];
  17. Like people said it can be due to the charset but if you want to successfully store anything like ' in the database and still prevent SQL attacks you could also use mysql real escape string.
  18. lol I don't think that's the problem... I have a dedicated server in Dallas Texas. Dual Xeon E5620 12GB of ram 2 x 250GB RE4 HDD's I've tried various tuning options and still can't seem to get MySQL to perform faster when doing queries that select a large amount of rows, I've tried running optimize on the table to defragment it and that doesn't do any good, i've tried loading the indexes into the cache, still doesn't help.
  19. For the past month my setup has been going just fine and haven't had any issues out of MySQL... I upgraded the CPU's recently to something a tiny bit more powerful and since then i've had nothing but problems... SELECT Count has just randomly became very very slow. The table I am using count on is around 6.4GB's big with around 60 million entries. As I said didn't have a problem till I swapped the CPU's out for something a bit higher up. The tables storage engines is MyISAM with a few indexes. But the slowness doesn't just effect this it can also effect another table at times that is 3 million entries but it's not AS slow as the primary one. My my.cnf [mysqld] socket = /var/lib/mysql/mysql.sock max_allowed_packet=64MB datadir=/var/lib/mysql safe-show-database old_passwords max_connections = 2000 key_buffer = 1024M myisam_sort_buffer_size = 150M join_buffer_size = 2M read_buffer_size = 2M sort_buffer_size = 2M table_cache = 2048 thread_cache_size = 50 interactive_timeout = 60 wait_timeout = 30 connect_timeout = 10 tmp_table_size = 200M max_heap_table_size = 200M max_connect_errors = 10 read_rnd_buffer_size = 4M query_cache_limit = 120M query_cache_size = 900M query_cache_type = 1 default-storage-engine = MyISAM log_slow_queries=/var/log/mysqld.slow.log long_query_time=2 key_buffer=64M sort_buffer=64M read_buffer=16M #write_buffer=16M query_prealloc_size = 65536 query_alloc_block_size = 131072 max_heap_table_size = 256M Has anyone ever ran into something similar to this? Or know of any way to fix this? I don't see why the CPU upgrade would cause this, haven't changed anything software configuration wise just hardware :\
  20. Oh, so you just need to execute the page. Do not want output? As i said cURL is useful for this.. But there are much easier ways.
  21. Ummmm.... I would suggest removing $this_path on the form action and just do ./page.php or something, see if it posts then, if it does then look into whatever you set $this_path
  22. If you mean you're trying to open a URL to get data from a page and add it to your database I could suggest cURL. I like it more then fopen, etc.
  23. First off you're not defining $delete. It should be $delete = $_POST['delete']; Another thing is you are not defining $checkbox If I remember correctly about adding multiple values into one checkbox name/id Should be $checkbox = explode(",",$_POST['checkbox[]'); Code should be something similar to this I believe. $delete = $_POST['delete']; $checkbox = explode(",", $_POST['checkbox[]'); if(isset($delete)){ foreach($checkbox as $id) { $sql = "DELETE FROM $tbl_name WHERE id='{$id}'"; $result = mysql_query($sql); } } Not entirely sure as I haven't used checkboxes in the same field name for awhile.
  24. If you're redirecting a user after the submit something I'd add Header at the end of the code that executes. <?php if (!isset($_POST['test_checkbox'])) { //Your code your excuting Header("Location: pageyouredirectto"); }
  25. I'd also add sleep(2); at the end inside the while loop so that you don't clog up your mail server or if you mail to the same email service it doesn't throw it up as spam because it sent 2 emails within under a second to two different clients. Just a suggestion.
×
×
  • 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.