Search Results

Search found 42698 results on 1708 pages for 'php in array'.

Page 3/1708 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Tracing Silex from PHP to the OS with DTrace

    - by cj
    In this blog post I show the full stack tracing of Brendan Gregg's php_syscolors.d script in the DTrace Toolkit. The Toolkit contains a dozen very useful PHP DTrace scripts and many more scripts for other languages and the OS. For this example, I'll trace the PHP micro framework Silex, which was the topic of the second of two talks by Dustin Whittle at a recent SF PHP Meetup. His slides are at Silex: From Micro to Full Stack. Installing DTrace and PHP The php_syscolors.d script uses some static PHP probes and some kernel probes. For Oracle Linux I discussed installing DTrace and PHP in DTrace PHP Using Oracle Linux 'playground' Pre-Built Packages. On other platforms with DTrace support, follow your standard procedures to enable DTrace and load the correct providers. The sdt and systrace providers are required in addition to fasttrap. On Oracle Linux, I loaded the DTrace modules like: # modprobe fasttrap # modprobe sdt # modprobe systrace # chmod 666 /dev/dtrace/helper Installing the DTrace Toolkit I download DTraceToolkit-0.99.tar.gz and extracted it: $ tar -zxf DTraceToolkit-0.99.tar.gz The PHP scripts are in the Php directory and examples in the Examples directory. Installing Silex I downloaded the "fat" Silex .tgz file from the download page and extracted it: $ tar -zxf silex_fat.tgz I changed the demonstration silex/web/index.php so I could use the PHP development web server: <?php // web/index.php $filename = __DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']); if (php_sapi_name() === 'cli-server' && is_file($filename)) { return false; } require_once __DIR__.'/../vendor/autoload.php'; $app = new Silex\Application(); //$app['debug'] = true; $app->get('/hello', function() { return 'Hello!'; }); $app->run(); ?> Running DTrace The php_syscolors.d script uses the -Z option to dtrace, so it can be started before PHP, i.e. when there are zero of the requested probes available to be traced. I ran DTrace like: # cd DTraceToolkit-0.99/Php # ./php_syscolors.d Next, I started the PHP developer web server in a second terminal: $ cd silex $ php -S localhost:8080 -t web web/index.php At this point, the web server is idle, waiting for requests. DTrace is idle, waiting for the probes in php_syscolors.d to be fired, at which time the action associated with each probe will run. I then loaded the demonstration page in a browser: http://localhost:8080/hello When the request was fulfilled and the simple output of "Hello" was displayed, I ^C'd php and dtrace in their terminals to stop them. DTrace output over a thousand lines long had been generated. Here is one snippet from when run() was invoked: C PID/TID DELTA(us) FILE:LINE TYPE -- NAME ... 1 4765/4765 21 Application.php:487 func -> run 1 4765/4765 29 ClassLoader.php:182 func -> loadClass 1 4765/4765 17 ClassLoader.php:198 func -> findFile 1 4765/4765 31 ":- syscall -> access 1 4765/4765 26 ":- syscall <- access 1 4765/4765 16 ClassLoader.php:198 func <- findFile 1 4765/4765 25 ":- syscall -> newlstat 1 4765/4765 15 ":- syscall <- newlstat 1 4765/4765 13 ":- syscall -> newlstat 1 4765/4765 13 ":- syscall <- newlstat 1 4765/4765 22 ":- syscall -> newlstat 1 4765/4765 14 ":- syscall <- newlstat 1 4765/4765 15 ":- syscall -> newlstat 1 4765/4765 60 ":- syscall <- newlstat 1 4765/4765 13 ":- syscall -> newlstat 1 4765/4765 13 ":- syscall <- newlstat 1 4765/4765 20 ":- syscall -> open 1 4765/4765 16 ":- syscall <- open 1 4765/4765 26 ":- syscall -> newfstat 1 4765/4765 12 ":- syscall <- newfstat 1 4765/4765 17 ":- syscall -> newfstat 1 4765/4765 12 ":- syscall <- newfstat 1 4765/4765 12 ":- syscall -> newfstat 1 4765/4765 12 ":- syscall <- newfstat 1 4765/4765 20 ":- syscall -> mmap 1 4765/4765 14 ":- syscall <- mmap 1 4765/4765 3201 ":- syscall -> mmap 1 4765/4765 27 ":- syscall <- mmap 1 4765/4765 1233 ":- syscall -> munmap 1 4765/4765 53 ":- syscall <- munmap 1 4765/4765 15 ":- syscall -> close 1 4765/4765 13 ":- syscall <- close 1 4765/4765 34 Request.php:32 func -> main 1 4765/4765 22 Request.php:32 func <- main 1 4765/4765 31 ClassLoader.php:182 func <- loadClass 1 4765/4765 33 Request.php:249 func -> createFromGlobals 1 4765/4765 29 Request.php:198 func -> __construct 1 4765/4765 24 Request.php:218 func -> initialize 1 4765/4765 26 ClassLoader.php:182 func -> loadClass 1 4765/4765 89 ClassLoader.php:198 func -> findFile 1 4765/4765 43 ":- syscall -> access ... The output shows PHP functions being called and returning (and where they are located) and which system calls the PHP functions in turn invoked. The time each line took from the previous one is displayed in the third column. The first column is the CPU number. In this example, the process was always on CPU 1 so the output is naturally ordered without requiring post-processing, or the D script requiring to be modified to display a time stamp. On a terminal, the output of php_syscolors.d is color-coded according to whether each function is a PHP or system one, hence the file name. Summary With one tool, I was able to trace the interaction of a user application with the operating system. I was able to do this to an application running "live" in a web context. The DTrace Toolkit provides a very handy repository of DTrace information. Even though the PHP scripts were created in the time frame of the original PHP DTrace PECL extension, which only had PHP function entry and return probes, the scripts provide core examples for custom investigation and resolution scripts. You can easily adapt the ideas and and create scripts using the other PHP static probes, which are listed in the PHP Manual. Because DTrace is "always on", you can take advantage of it to resolve development questions or fix production situations.

    Read the article

  • How to retrieve an array from Multidimensional Array.

    - by Mike Smith
    So I have a multi-dimensional array looks like this. $config = array( "First Name" => array( "user" => $_POST['firstname'], "limit" => 35, ), "Last Name" => array( "user" => $_POST['lastname'], "limit" => 40, ), ); I want use the array that's within the config array, so my approach is to use a foreach loop. foreach($config as $field => $data) { } Now I know that $data will be my array, but it seems I can't use it outside of the foreach statement because I only get half of whats already there. Using print_r you can see what it shows outside the loop: Array ( [user] => lastname [limit] => 40 ) But when inside the loop and I use print_r here is my result: Array ( [user] => firstname [limit] => 35 ) Array ( [user] => lastname [limit] => 40 ) I imagine it has to do something with it being with the foreach loop. I've tried to run a foreach on the $data array to populate another array, but that didn't work as well. Is there a way to use this outside of a foreach loop? Sorry if this a dumb question, I'm sure there is a quite a simple answer to this, but I'm just stumped, and can't think of a way to do this. Thanks.

    Read the article

  • PHP manipulating multidimensional array values

    - by Joker
    I have a result set as an array from a database that looks like: array ( 0 => array ( "a" => "something" "b" => "something" "c" => "something" ) 1 => array ( "a" => "something" "b" => "something" "c" => "something" ) 2 => array ( "a" => "something" "b" => "something" "c" => "something" ) ) How would I apply a function to replace the values of an array only on the array key with b? Normally I would just rebuild a new array with a foreach loop and apply the function if the array key is b, but I'm not sure if it's the best way. I've tried taking a look at many array functions and it seemed like array_walk_recursive is something I might use, but I didn't have luck in getting it to do what I want. If I'm not describing it well enough, basically I want to be able to do as the code below does: $arr = array(); foreach ($result as $key => $value) { foreach ($value as $key2 => $value2) { $arr[$key][$key2] = ($key2 == 'b' ? $this->_my_method($value2) : $value2); } } Should I stick with that, or is there a better way?

    Read the article

  • (PHP) Converting an array of arrays from one format into another

    - by Richard Carter
    Hi, I currently have an array, created from a database, an example of which looks like the following: Array( [0] => Array ( objectid => 2, name => title, value => apple ), [1] => Array ( objectid => 2, name => colour, value => red ), [2] => Array ( objectid => 3, name => title, value => pear ), [3] => Array ( objectid => 3, name => colour, value => green ) ) What I would like to do is group all the items in the array by their objectid, and convert the 'name' values into keys and 'value' values into values of an associative array....like below: Array ( [0] => Array ( objectid => 2, title => apple, colour => red ), [1] => Array ( objectid => 3, title => pear, colour => green ) ) I've tried a few things but haven't really got anywhere.. Any ideas? Thanks in advance

    Read the article

  • extract associative array within an array in php

    - by I Like PHP
    i have an array like this Array ( [0] => Array ( [s_id] => 4 [si_id] => sec_1 [d_id] => dep_4 [s_name] => sec1 [s_location] => LA [s_visibility] => yes [s_created_date] => 1273639343 [s_last_updated_date] => 1273639343 [s_created_by] => someone [s_last_updated_by] => everyone ) ) now i want to extract array[0] into an array... means i want this Array ( [s_id] => 4 [si_id] => sec_1 [d_id] => dep_4 [s_name] => sec1 [s_location] => LA [s_visibility] => yes [s_created_date] => 1273639343 [s_last_updated_date] => 1273639343 [s_created_by] => someone [s_last_updated_by] => everyone ) how do i get above results?

    Read the article

  • Loop through multi-dimensional array and remove certain keys

    - by Webkungen
    Hi! I've got a nested tree structure which is based on the array below: Array ( [1] = Array ( [id] = 1 [parent] = 0 [name] = Startpage [uri] = 125 [basename] = index.php [child] = ) [23] = Array ( [id] = 23 [parent] = 0 [name] = Events [uri] = 0 [basename] = [child] = Array ( [24] = Array ( [id] = 24 [parent] = 23 [name] = Public news [uri] = 0 [basename] = [child] = Array ( [27] = Array ( [id] = 27 [parent] = 24 [name] = Add [uri] = 100 [basename] = news.public.add.php [child] = ) [28] = Array ( [id] = 28 [parent] = 24 [name] = Overview [uri] = 101 [basename] = news.public.overview.php [child] = ) ) ) [25] = Array ( [id] = 25 [parent] = 23 [name] = Private news [uri] = 0 [basename] = [child] = Array ( [29] = Array ( [id] = 29 [parent] = 25 [name] = Add [uri] = 67 [basename] = news.private.add.php [child] = ) [30] = Array ( [id] = 30 [parent] = 25 [name] = Overview [uri] = 68 [basename] = news.private.overview.php [child] = ) ) ) [26] = Array ( [id] = 26 [parent] = 23 [name] = Calendar [uri] = 0 [basename] = [child] = Array ( [31] = Array ( [id] = 31 [parent] = 26 [name] = Add [uri] = 69 [basename] = news.event.add.php [child] = ) [32] = Array ( [id] = 32 [parent] = 26 [name] = Overview [uri] = 70 [basename] = news.event.overview.php [child] = ) ) ) ) ) ) I'm looking for a function to loop (recursive?) through the array and remove some keys. I my system I can allow users to certain functions/pages and if I deny access to the whole "block" "Events", the array will look like this: Array ( [1] = Array ( [id] = 1 [parent] = 0 [name] = Startpage [uri] = 125 [basename] = index.php [child] = ) [23] = Array ( [id] = 23 [parent] = 0 [name] = Events [uri] = 0 [basename] = [child] = Array ( [24] = Array ( [id] = 24 [parent] = 23 [name] = Public news [uri] = 0 [basename] = [child] = ) [25] = Array ( [id] = 25 [parent] = 23 [name] = Private news [uri] = 0 [basename] = [child] = ) [26] = Array ( [id] = 26 [parent] = 23 [name] = Calendar [uri] = 0 [basename] = [child] = ) ) ) ) As you can see above, the whole "block" "Events" is useless right now, becuase there is no page associated with each option. So I need to find all "keys" where "basename" is null AND where child is not an array or where the array is empty and remove them. I found this function when searching the site: function searchAndDestroy(&$a, $key, $val){ foreach($a as $k = &$v){ if(is_array($v)){ $r = searchAndDestroy($v, $key, $val); if($r){ unset($a[$k]); } }elseif($key == $k && $val == $v){ return true; } } return false; } It can be used to remove a key any where in the array, but only based in one thing, for example remove all keys where "parent" equals "23". But I need to find and remove (unset) all keys where "basename" is null AND where child isn't an array or where the array is empty. Can anyone help me out and possibly tweak the function above? Thank you,

    Read the article

  • Foreach PHP Error

    - by Logan
    I am receiving the following foreach error on my PHP file and I have no idea how to fix it. Does anyone have any ideas? When I load the page I get this: Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 61 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/merge/class/global_functions.php on line 89 Line 61 and 89 of my /class/global_functions.php are as followed: Here is my code from line 61 to line 98: foreach($GLOBALS['userpermbit'] as $v) { if(strstr($v['perm'],'|'.$pageperm_id[0]['id'].'|')) return true; } //if they dont have perms and we're not externally including functions return false if ($GLOBALS['external'] != true) return false; return true; } //FUNCTION: quick perm check using perm info from the onload perm check function stealthPermCheck($req) { #if theyre an admin give them perms if(@in_array($GLOBALS['user'][0]['id'], $GLOBALS['superAdmins'])) return true; if(!is_numeric($req)) { #if the req is numeric we need to match a title, not a permid. So try to do that foreach($GLOBALS['userpermbit'] as $v) { if(stristr($v['title'],$req)) return true; } }else{ #check if they have perms numerically if so return true foreach($GLOBALS['userpermbit'] as $v) { if(strstr($v['perm'],'|'.$req.'|')) return true; } } #if none of this returned true they dont have perms, return false return false; }

    Read the article

  • PHP: Can pcntl_alarm() and socket_select() peacefully exist in the same thread?

    - by DWilliams
    I have a PHP CLI script mostly written that functions as a chat server for chat clients to connect to (don't ask me why I'm doing it in PHP, thats another story haha). My script utilizes the socket_select() function to hang execution until something happens on a socket, at which point it wakes up, processes the event, and waits until the next event. Now, there are some routine tasks that I need performed every 30 seconds or so (check of tempbanned users should be unbanned, save user databases, other assorted things). From what I can tell, PHP doesn't have very great multi-threading support at all. My first thought was to compare a timestamp every time the socket generates an event and gets the program flowing again, but this is very inconsistent since the server could very well sit idle for hours and not have any of my cleanup routines executed. I came across the PHP pcntl extensions, and it lets me use assign a time interval for SIGALRM to get sent and a function get executed every time it's sent. This seems like the ideal solution to my problem, however pcntl_alarm() and socket_select() clash with each other pretty bad. Every time SIGALRM is triggered, all sorts of crazy things happen to my socket control code. My program is fairly lengthy so I can't post it all here, but it shouldn't matter since I don't believe I'm doing anything wrong code-wise. My question is: Is there any way for a SIGALRM to be handled in the same thread as a waiting socket_select()? If so, how? If not, what are my alternatives here? Here's some output from my program. My alarm function simply outputs "Tick!" whenever it's called to make it easy to tell when stuff is happening. This is the output (including errors) after allowing it to tick 4 times (there were no actual attempts at connecting to the server despite what it says): [05-28-10 @ 20:01:05] Chat server started on 192.168.1.28 port 4050 [05-28-10 @ 20:01:05] Loaded 2 users from file PHP Notice: Undefined offset: 0 in /home/danny/projects/PHPChatServ/ChatServ.php on line 112 PHP Warning: socket_select(): unable to select [4]: Interrupted system call in /home/danny/projects/PHPChatServ/ChatServ.php on line 116 [05-28-10 @ 20:01:15] Tick! PHP Warning: socket_accept(): unable to accept incoming connection [4]: Interrupted system call in /home/danny/projects/PHPChatServ/ChatServ.php on line 126 [05-28-10 @ 20:01:25] Tick! PHP Warning: socket_getpeername() expects parameter 1 to be resource, boolean given in /home/danny/projects/PHPChatServ/ChatServ.php on line 129 [05-28-10 @ 20:01:25] Accepting socket connection from PHP Notice: Undefined offset: 1 in /home/danny/projects/PHPChatServ/ChatServ.php on line 112 PHP Warning: socket_select(): unable to select [4]: Interrupted system call in /home/danny/projects/PHPChatServ/ChatServ.php on line 116 [05-28-10 @ 20:01:35] Tick! PHP Warning: socket_accept(): unable to accept incoming connection [4]: Interrupted system call in /home/danny/projects/PHPChatServ/ChatServ.php on line 126 [05-28-10 @ 20:01:45] Tick! PHP Warning: socket_getpeername() expects parameter 1 to be resource, boolean given in /home/danny/projects/PHPChatServ/ChatServ.php on line 129 [05-28-10 @ 20:01:45] Accepting socket connection from PHP Notice: Undefined offset: 2 in /home/danny/projects/PHPChatServ/ChatServ.php on line 112

    Read the article

  • adding up value of array and getting the average

    - by sea_1987
    I have an array that looks similar to this, [4] => Common_Model Object ( [id] => 4 [name] => [date_created] => [last_updated] => [user_id_updated] => [_table] => [_aliases] => Array ( [id] => 4 [name] => [date_created] => [date_updated] => [user_id_updated] => [rating] => 3 [recipe_id] => 5 ) [_nonDBAliases] => Array ( ) [_default] => Array ( ) [_related] => Array ( ) [_enums] => [_alsoDelete] => Array ( ) [_readOnly] => Array ( [0] => date_updated ) [_valArgs] => Array ( ) [_valArgsHash] => Array ( [default] => Array ( ) ) [_valAliases] => Array ( ) [_extraData] => Array ( ) [_inputs] => Array ( ) [_tableName] => jm_ratings [_tablePrefix] => [_niceDateUpdated] => 1st Jan 70 [_niceDateCreated] => 1st Jan 70 [_fetchAdminData] => [_mCache] => [_assets] => Array ( ) ) [3] => Common_Model Object ( [id] => 3 [name] => [date_created] => [last_updated] => [user_id_updated] => [_table] => [_aliases] => Array ( [id] => 3 [name] => [date_created] => [date_updated] => [user_id_updated] => [rating] => 1 [recipe_id] => 5 ) [_nonDBAliases] => Array ( ) [_default] => Array ( ) [_related] => Array ( ) [_enums] => [_alsoDelete] => Array ( ) [_readOnly] => Array ( [0] => date_updated ) [_valArgs] => Array ( ) [_valArgsHash] => Array ( [default] => Array ( ) ) [_valAliases] => Array ( ) [_extraData] => Array ( ) [_inputs] => Array ( ) [_tableName] => jm_ratings [_tablePrefix] => [_niceDateUpdated] => 1st Jan 70 [_niceDateCreated] => 1st Jan 70 [_fetchAdminData] => [_mCache] => [_assets] => Array ( ) ) [2] => Common_Model Object ( [id] => 2 [name] => [date_created] => [last_updated] => [user_id_updated] => [_table] => [_aliases] => Array ( [id] => 2 [name] => [date_created] => [date_updated] => [user_id_updated] => [rating] => 1 [recipe_id] => 5 ) [_nonDBAliases] => Array ( ) [_default] => Array ( ) [_related] => Array ( ) [_enums] => [_alsoDelete] => Array ( ) [_readOnly] => Array ( [0] => date_updated ) [_valArgs] => Array ( ) [_valArgsHash] => Array ( [default] => Array ( ) ) [_valAliases] => Array ( ) [_extraData] => Array ( ) [_inputs] => Array ( ) [_tableName] => jm_ratings [_tablePrefix] => [_niceDateUpdated] => 1st Jan 70 [_niceDateCreated] => 1st Jan 70 [_fetchAdminData] => [_mCache] => [_assets] => Array ( ) ) I wanting to add up the [rating] and get the mean average. But I dont know how do this with PHP, my attempt looks like this, <?php foreach ($rt as $rating) { $total = $rating->rating + $rating->rating } $total / count($rt); ?>

    Read the article

  • Easiest way to remove Keys from a 2D Array?

    - by dbemerlin
    Hi, I have an Array that looks like this: array( 0 => array( 'key1' => 'a', 'key2' => 'b', 'key3' => 'c' ), 1 => array( 'key1' => 'c', 'key2' => 'b', 'key3' => 'a' ), ... ) I need a function to get an array containing just a (variable) number of keys, i.e. reduce_array(array('key1', 'key3')); should return: array( 0 => array( 'key1' => 'a', 'key3' => 'c' ), 1 => array( 'key1' => 'c', 'key3' => 'a' ), ... ) What is the easiest way to do this? If possible without any additional helper function like array_filter or array_map as my coworkers already complain about me using too many functions. The source array will always have the given keys so it's not required to check for existance. Bonus points if the values are unique (the keys will always be related to each other, meaning that if key1 has value a then the other key(s) will always have value b). My current solution which works but is quite clumsy (even the name is horrible but can't find a better one): function get_unique_values_from_array_by_keys(array $array, array $keys) { $result = array(); $found = array(); if (count($keys) > 0) { foreach ($array as $item) { if (in_array($item[$keys[0]], $found)) continue; array_push($found, $item[$keys[0]]); $result_item = array(); foreach ($keys as $key) { $result_item[$key] = $item[$key]; } array_push($result, $result_item); } } return $result; } Addition: PHP Version is 5.1.6.

    Read the article

  • Define 2D array with loops in php

    - by Michael
    I have an array $rows where each element is a row of 15 tab-delimited values. I want to explode $rows into a 2D array $rowData where each row is an array element and each tab-delimited value is assigned to a different array element. I've tried these two methods without success. I know the first one has a coding error but I do not know how to correct it. Any help would be amazing. for ($i=0; $i<count($rows); $i++){ for ($j=0; $j<15; $j++){ $rowData = array([$i] => array (explode(" ", $rows[$j]))); } } foreach ($rows as $value){ $rowData = array( array (explode(" ", $rows[$value]))); }

    Read the article

  • Convert complex numerical array to associative array [PHP]

    - by user1500412
    I have an array data that look like this : Array ( [0] => Array ( [0] => Name: [1] => John W. [2] => Registration ID: [3] => 36 ) [1] => Array ( [0] =>Age: [1] => 35 [2] => Height: [3] => 5'11" ) [3] => Array ( [0] => Sex: [1] => M [2] => Weight: [3] => 200lbs ) [4] => Array ( [0] => Address ) [5] => Array ( [0] => 6824 crestwood dr delphi, IN 46923 )) And I want to convert it to associative array like this : Array( ['Name']=> John W. ['Registration ID']=> 36 ['Age']=> 35 ['Height'] => 5'11'' ['Sex']=>M ['Weight']=>200lbs ['Address']=>6824 crestwood dr delphi, IN 46923 ) I have no idea at all how to do this, since the supposed to be array column header were also in sequence, so it makes difficult to convert this array. Any help I appreciate, thx.

    Read the article

  • PHP OCI8 and Oracle 11g DRCP Connection Pooling in Pictures

    - by christopher.jones
    Here is a screen shot from a PHP OCI8 connection pooling demo that I like to run. It graphically shows how little database host memory is needed when using DRCP connection pooling with Oracle Database 11g. Migrating to DRCP can be as simple as starting the pool and changing the connection string in your PHP application. The script that generated the data for this graph was a simple "Parts" query application being run under various simulated user loads. I was running the database on a small Oracle Linux server with just 2G of memory. I used PHP OCI8 1.4. Apache is in pre-fork mode, as needed for PHP. Each graph has time on the horizontal access in arbitrary 'tick' time units. Click the image to see it full sized. Pooled connections Beginning with the top left graph, At tick time 65 I used Apache's 'ab' tool to start 100 concurrent 'users' running the application. These users connected to the database using DRCP: $c = oci_pconnect('phpdemo', 'welcome', 'myhost/orcl:pooled'); A second hundred DRCP users were added to the system at tick 80 and a final hundred users added at tick 100. At about tick 110 I stopped the test and restarted Apache. This closed all the connections. The bottom left graph shows the number of statements being executed by the database per second, with some spikes for background database activity and some variability for this small test. Each extra batch of users adds another 'step' of load to the system. Looking at the top right Server Process graph shows the database server processes doing the query work for each web user. As user load is added, the DRCP server pool increases (in green). The pool is initially at its default size 4 and quickly ramps up to about (I'm guessing) 35. At tick time 100 the pool increases to my configured maximum of 40 processes. Those 40 processes are doing the query work for all 300 web users. When I stopped the test at tick 110, the pooled processes remained open waiting for more users to connect. If I had left the test quiet for the DRCP 'inactivity_timeout' period (300 seconds by default), the pool would have shrunk back to 4 processes. Looking at the bottom right, you can see the amount of memory being consumed by the database. During the initial quiet period about 500M of memory was in use. The absolute number is just an indication of my particular DB configuration. As the number of pooled processes increases, each process needs more memory. You can see the shape of the memory graph echoes the Server Process graph above it. Each of the 300 web users will also need a few kilobytes but this is almost too small to see on the graph. Non-pooled connections Compare the DRCP case with using 'dedicated server' processes. At tick 140 I started 100 web users who did not use pooled connections: $c = oci_pconnect('phpdemo', 'welcome', 'myhost/orcl'); This connection string change is the only difference between the two tests. At ticks 155 and 165 I started two more batches of 100 simulated users each. At about tick 195 I stopped the user load but left Apache running. Apache then gradually returned to its quiescent state, killing idle httpd processes and producing the downward slope at the right of the graphs as the persistent database connection in each Apache process was closed. The Executions per Second graph on the bottom left shows the same step increases as for the earlier DRCP case. The database is handling this load. But look at the number of Server processes on the top right graph. There is now a one-to-one correspondence between Apache/PHP processes and DB server processes. Each PHP processes has one DB server processes dedicated to it. Hence the term 'dedicated server'. The memory required on the database is proportional to all those database server processes started. Almost all my system's memory was consumed. I doubt it would have coped with any more user load. Summary Oracle Database 11g DRCP connection pooling significantly reduces database host memory requirements allow more system memory to be allocated for the SGA and allowing the system to scale to handled thousands of concurrent PHP users. Even for small systems, using DRCP allows more web users to be active. More information about PHP and DRCP can be found in the PHP Scalability and High Availability chapter of The Underground PHP and Oracle Manual.

    Read the article

  • PHP-FPM runs PHP scripts as root

    - by fwalch
    I have a web server setup using nginx and PHP-FPM listening on a Unix socket. In my php-fpm.conf, I have specified user = www group = www When I run ps aux, I can see that the php-fpm worker processes run as www; the php-fpm master process runs as root. However, I noticed that PHP scripts are executed as root; at least that's the output of echo get_current_user(); What can I do to run scripts as the www user? How can this even happen if the worker processes run as www?

    Read the article

  • PHP - My array returns NULL values when placed in a function, but works fine outside of the function

    - by orbit82
    Okay, let me see if I can explain this. I am making a newspaper WordPress theme. The theme pulls posts from categories. The front page shows multiple categories, organized as "newsboxes". Each post should show up only ONCE on the front page, even if said post is in two or more categories. To prevent posts from duplicating on the front page, I've created an array that keeps track of the individual post IDs. When a post FIRST shows up on the front page, its ID gets added to the array. Before looping through the posts for each category, the code first checks the array to see which posts have ALREADY been displayed. OK, so now remember how I said earlier that the front page shows multiple categories organized as "newsboxes"? Well, these newsboxes are called onto the front page using PHP includes. I have 6 newsboxes appearing on the front page, and the code to call them is EXACTLY the same. I didn't want to repeat the same code 6 times, so I put all of the inclusion code into a function. The function works, but the only problem is that it screws up the duplicate posts code I mentioned earlier. The posts all repeat. Running a var_dump on the $do_not_duplicate variable returns an array with null indices. Everything works PERFECTLY if I don't put the code inside a function, but once I do put them in a function it's like the arrays aren't even connecting with the posts. Here is the code with the arrays. The key variables in question here include $do_not_duplicate[] = $post-ID, $do_not_duplicate and 'post__not_in' = $do_not_duplicate <?php query_posts('cat='.$settings['cpress_top_story_category'].'&posts_per_page='.$settings['cpress_number_of_top_stories'].'');?> <?php if (have_posts()) : ?> <!--TOP STORY--> <div id="topStory"> <?php while ( have_posts() ) : the_post(); $do_not_duplicate[] = $post->ID; ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_post_thumbnail('top-story-thumbnail'); ?></a> <h2 class="extraLargeHeadline"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="topStory_author"><?php cpress_show_post_author_byline(); ?></div> <div <?php post_class('topStory_entry') ?> id="post-<?php the_ID(); ?>"> <?php if($settings['cpress_excerpt_or_content_top_story_newsbox'] == "content") { the_content(); ?><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><span class="read_more"><?php echo $settings['cpress_more_text']; ?></span></a> <?php } else { the_excerpt(); ?><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><span class="read_more"><?php echo $settings['cpress_more_text']; ?></span></a> <?php }?> </div><!--/topStoryentry--> <div class="topStory_meta"><?php cpress_show_post_meta(); ?></div> <?php endwhile; wp_reset_query(); ?> <?php if(!$settings['cpress_hide_top_story_more_stories']) { ?> <!--More Top Stories--><div id="moreTopStories"> <?php $category_link = get_category_link(''.$settings['cpress_top_story_category'].''); ?> <?php if (have_posts()) : ?> <?php query_posts( array( 'cat' => ''.$settings['cpress_top_story_category'].'', 'posts_per_page' => ''.$settings['cpress_number_of_more_top_stories'].'', 'post__not_in' => $do_not_duplicate ) ); ?> <h4 class="moreStories"> <?php if($settings['cpress_make_top_story_more_stories_link']) { ?> <a href="<?php echo $category_link; ?>" title="<?php echo strip_tags($settings['cpress_top_story_more_stories_text']);?>"><?php echo strip_tags($settings['cpress_top_story_more_stories_text']);?></a><?php } else { echo strip_tags($settings['cpress_top_story_more_stories_text']); } ?> </h4> <ul> <?php while( have_posts() ) : the_post(); $do_not_duplicate[] = $post->ID; ?> <li><h2 class="mediumHeadline"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <?php if(!$settings['cpress_hide_more_top_stories_excerpt']) { ?> <div <?php post_class('moreTopStory_postExcerpt') ?> id="post-<?php the_ID(); ?>"><?php if($settings['cpress_excerpt_or_content_top_story_newsbox'] == "content") { the_content(); ?><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><span class="read_more"><?php echo $settings['cpress_more_text']; ?></span></a> <?php } else { the_excerpt(); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><span class="read_more"><?php echo $settings['cpress_more_text']; ?></span></a> <?php }?> </div><?php } ?> <div class="moreTopStory_postMeta"><?php cpress_show_post_meta(); ?></div> </li> <?php endwhile; wp_reset_query(); ?> </ul> <?php endif;?> </div><!--/moreTopStories--> <?php } ?> <?php echo(var_dump($do_not_duplicate)); ?> </div><!--/TOP STORY--> <?php endif; ?> And here is the code that includes the newsboxes onto the front page. This is the code I'm trying to put into a function to avoid duplicating it 6 times on one page. function cpress_show_templatebitsf($tbit_num, $tbit_option) { global $tbit_path; global $shortname; $settings = get_option($shortname.'_options'); //display the templatebits (usually these will be sidebars) for ($i=1; $i<=$tbit_num; $i++) { $tbit = strip_tags($settings[$tbit_option .$i]); if($tbit !="") { include_once(TEMPLATEPATH . $tbit_path. $tbit.'.php'); } //if }//for loop unset($tbit_option); } I hope this makes sense. It's kind of a complex thing to explain but I've tried many things to fix it and have had no luck. I'm stumped. I'm hoping it's just some little thing I'm overlooking because it seems like it shouldn't be such a problem.

    Read the article

  • multiple php compiler on single apache installation

    - by getmizanur
    elloo, i have some old php scripts which runs on php-5.2.x and the current server has php-5.3.x. to get around this problem,i have got two options one is to downgrade php-5.3.x or install php-5.2.x and php-5.3.x at the same time where php-5.2.x serve cgi script. i have decided go for the second option i have followed this tutorial and i can get most of it working however except execution of shell script which selects php-cgi version. i cannot get apache to execute this script. how do i get apache to execute #!/bin/sh # you can change the PHP version here. version="5.2.6" # php.ini file location, */php-5.2.6/lib equals */php-5.2.6/lib/php.ini. PHPRC=/etc/php/phpfarm/inst/php-${version}/lib/php.ini export PHPRC PHP_FCGI_CHILDREN=3 export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=5000 export PHP_FCGI_MAX_REQUESTS # which php-cgi binary to execute exec /etc/php/phpfarm/inst/php-${version}/bin/php-cgi my apache vhost.conf <VirtualHost *:80> ServerName 526.localhost DocumentRoot /home/getmizanur/public_html/www <Directory "/home/getmizanur/public_html/www"> AddHandler php-cgi .php Action php-cgi /php-fcgi/php-cgi-5.2.6 </Directory> </VirtualHost> can some one tell me what am i doing wrong? thanks in advance. solution: if i did a2dismod php5 then the above configuration worked. when a2enmod php5 had been activated, apache was executing php5.3 instead of php5.2 even after telling apache to execute php5.2 shell script. to solve my problem, i had to change my virtualhost configuration <VirtualHost *:80> ServerName 526.localhost DocumentRoot /home/getmizanur/public_html/www DirectoryIndex index.php <Directory "/home/getmizanur/public_html/www"> AddHandler php-cgi .php Action php-cgi /php-fcgi/php-cgi-5.2.6 <FilesMatch "\.php"> SetHandler php-cgi </FilesMatch> </Directory> </VirtualHost> presto, it started working.

    Read the article

  • "Unable to initialize module" fileinfo php-pecl-Fileinfo.x86_64

    - by Myers Network
    I have a brand new server server that I am trying to get setup up. This is a 64 bit machine that I can not install "fileinfo" or "memcache". I have uninstalled these and reinstalled them using yum and pecl with no luck. Yum install fine "no error" but then get error when running php. pecl from what I can tell is only installing 32bit. Does not put anything in the lib64 directory. Here is my output from php -v: PHP Warning: PHP Startup: fileinfo: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 PHP 5.2.14 (cli) (built: Aug 12 2010 16:03:48) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies Here is some other system info incase you need it uname: Linux server.actham.us 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010 x86_64 x86_64 x86_64 GNU/Linux php -m: PHP Warning: PHP Startup: fileinfo: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 [PHP Modules] bz2 calendar ctype curl date dbase dom exif filter ftp gd gettext gmp hash iconv imap json ldap libxml mbstring mcrypt mysql mysqli openssl pcntl pcre PDO pdo_mysql pdo_sqlite readline Reflection session shmop SimpleXML sockets SPL standard tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules] Any help would be greatly appreciated, thanks....

    Read the article

  • "Unable to initialize module" fileinfo php-pecl-Fileinfo.x86_64

    - by Myers Network
    I have a brand new server server that I am trying to get setup up. This is a 64 bit machine that I can not install "fileinfo" or "memcache". I have uninstalled these and reinstalled them using yum and pecl with no luck. Yum install fine "no error" but then get error when running php. pecl from what I can tell is only installing 32bit. Does not put anything in the lib64 directory. Here is my output from php -v: PHP Warning: PHP Startup: fileinfo: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 PHP 5.2.14 (cli) (built: Aug 12 2010 16:03:48) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies Here is some other system info incase you need it uname: Linux server.actham.us 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010 x86_64 x86_64 x86_64 GNU/Linux php -m: PHP Warning: PHP Startup: fileinfo: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0 [PHP Modules] bz2 calendar ctype curl date dbase dom exif filter ftp gd gettext gmp hash iconv imap json ldap libxml mbstring mcrypt mysql mysqli openssl pcntl pcre PDO pdo_mysql pdo_sqlite readline Reflection session shmop SimpleXML sockets SPL standard tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules] Any help would be greatly appreciated, thanks....

    Read the article

  • Converting a flat array to a nested array

    - by matte
    Hi, I am trying to convert a flat array to a nested array depending on the 'level' data of each array item. 'level' data shows us if current array item is a child, a parent or a sibling. Here is the flat array: $sequentialArray = array( array('title'=>'Page 1', 'level'=>0), array('title'=>'Page 2', 'level'=>0), array('title'=>'Page 3', 'level'=>1), array('title'=>'Page 4', 'level'=>1), array('title'=>'Page 5', 'level'=>2), array('title'=>'Page 6', 'level'=>0), array('title'=>'Page 7', 'level'=>1), array('title'=>'Page 8', 'level'=>0) ); And here is the expected result: $nestedArray = array( array('title'=>'Page 1', 'children'=>array()), array('title'=>'Page 2', 'children'=>array( array('title'=>'Page 3', 'children'=>array()), array('title'=>'Page 4', 'children'=>array( array('title'=>'Page 5', 'children'=>array()) )), )), array('title'=>'Page 6', 'children'=>array( array('title'=>'Page 7', 'children'=>array()) )), array('title'=>'Page 8', 'children'=>array()), ); I tried using references with array indexes but that didn't work. Any ideas?

    Read the article

  • How to combine these two PHP arrays ?

    - by Annan
    I have two arrays in php that are part of an image management system. weighted_images A multidimensional array. Each sub array is an associative array with keys of 'weight' (for ordering by) and 'id' (the id of the image). array( 156 => array('weight'=>1, 'id'=>156), 784 => array('weight'=>-2, 'id'=>784), ) images This array is user input. It's an array of image ids. array(784, 346, 748) I want to combine them in to a single array of ids ordered by the weight of the image. If an image doesn't have a weight append to the end. It's not a particularly hard problem however my solution is far from elegant and can't help thinking that there must be a better way to do this. $t_images = array(); foreach ($weighted_images as $wi) { if ( in_array($wi['id'], $images) ) { $t_images[$wi['weight']] = $wi['id']; } } foreach ($images as $image) { if ( !$weighted_images[$image] ) { $t_images[] = $image; } } $images = $t_images; Question: Is there a better way to do this?

    Read the article

  • Upgrading PHP from 5.1 to 5.2 on CentOS 5.4

    - by andufo
    i'm trying to upgrade php 5.1 to 5.2 on a CentOS 5.4 I use: yum upgrade php The result is this (check out the last part): [root@mail httpd]# yum update php Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirror.raystedman.net * base: mirrors.serveraxis.net * centosplus: mirrors.tummy.com * contrib: mirror.raystedman.net * extras: mirror.raystedman.net * updates: mirrors.netdna.com Setting up Update Process Resolving Dependencies --> Running transaction check --> Processing Dependency: php = 5.1.6-27.el5 for package: php-devel --> Processing Dependency: php = 5.1.6 for package: php-eaccelerator ---> Package php.x86_64 0:5.2.10-1.el5.centos set to be updated --> Processing Dependency: php-cli = 5.2.10-1.el5.centos for package: php --> Processing Dependency: php-common = 5.2.10-1.el5.centos for package: php --> Running transaction check --> Processing Dependency: php = 5.1.6 for package: php-eaccelerator ---> Package php-cli.x86_64 0:5.2.10-1.el5.centos set to be updated --> Processing Dependency: php-common = 5.1.6-27.el5 for package: php-xml --> Processing Dependency: php-common = 5.1.6-27.el5 for package: php-pdo --> Processing Dependency: php-common = 5.1.6-27.el5 for package: php-gd --> Processing Dependency: php-common = 5.1.6-27.el5 for package: php-ldap --> Processing Dependency: php-common = 5.1.6-27.el5 for package: php-mbstring --> Processing Dependency: php-common = 5.1.6-27.el5 for package: php-mysql --> Processing Dependency: php-common = 5.1.6-27.el5 for package: php-imap ---> Package php-common.x86_64 0:5.2.10-1.el5.centos set to be updated ---> Package php-devel.x86_64 0:5.2.10-1.el5.centos set to be updated --> Running transaction check --> Processing Dependency: php = 5.1.6 for package: php-eaccelerator ---> Package php-gd.x86_64 0:5.2.10-1.el5.centos set to be updated ---> Package php-imap.x86_64 0:5.2.10-1.el5.centos set to be updated ---> Package php-ldap.x86_64 0:5.2.10-1.el5.centos set to be updated ---> Package php-mbstring.x86_64 0:5.2.10-1.el5.centos set to be updated ---> Package php-mysql.x86_64 0:5.2.10-1.el5.centos set to be updated ---> Package php-pdo.x86_64 0:5.2.10-1.el5.centos set to be updated ---> Package php-xml.x86_64 0:5.2.10-1.el5.centos set to be updated --> Finished Dependency Resolution php-eaccelerator-5.1.6_0.9.5.2-4.el5.rf.x86_64 from installed has depsolving problems --> Missing Dependency: php = 5.1.6 is needed by package php-eaccelerator-5.1.6_0.9.5.2-4.el5.rf.x86_64 (installed) Error: Missing Dependency: php = 5.1.6 is needed by package php-eaccelerator-5.1.6_0.9.5.2-4.el5.rf.x86_64 (installed) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest The program package-cleanup is found in the yum-utils package. [root@mail httpd]# What are the consequences of using --skip-broken? Any recommendations?

    Read the article

  • Learn to use PHP and Python with Oracle Database

    - by christopher.jones
    The Oracle Learning Library has posted up the latest "Oracle By Example" labs giving an introduction to PHP & Python with the Oracle Database : Using PHP with Oracle Database 11g - a basic introduction Developing a PHP Web Application with Oracle Database 11g - a Zend Framework application using the NetBeans IDE Using Python With Oracle Database 11g - a basic introduction Using the Django Framework with Python and Oracle Database 11g - a basic web application

    Read the article

  • SQL Server Driver for PHP 2.0 CTP2 is now released

    - by The Official Microsoft IIS Site
    digg_url = "http://blogs.msdn.com/b/sqlphp/archive/2010/06/15/sql-server-driver-for-php-2-0-ctp2-is-now-released.aspx";digg_title = "SQL Server Driver for PHP 2.0 CTP2 is now released";digg_bgcolor = "#FFFFFF";digg_skin = "normal"; digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined; It is our pleasure to announce the release of Community Technology Preview 2 (CTP2) of the SQL Server Driver for PHP 2.0! We would like to...(read more)

    Read the article

  • Webserver insists on opening "blog1.php" instead of "index.php"

    - by pepoluan
    I'm at my wits' end. I have just ripped out a website and in the process of rebuilding everything. Previously, the 'home page' of the website is a blog, with the address "www.mydomain.com/blog1.php". After exporting everything, I deleted the whole directory, and -- based on request -- immediately create a blog/ directory. The idea is to get the blog back up as soon as possible, and temporarily redirect people accessing www.mydomain.com to the blog. Accessing the blog via http://www.mydomain.com/blog/ works. So I put in an index.php file containing a (temporary) redirect to the blog's address. The problem: The server insists on opening blog1.php instead of index.php. Even after we deleted all the files (including .htaccess). And even putting in a new .htaccess file with the single line of DirectoryIndex index.php doesn't work. The server stubbornly wants blog1.php. Now, the server is actually a webhosting, so I have no actual access to it. I have to do my work via cPanel. Currently, I work around this issue by creating blog1.php; but I really want to know why the server does not revert to opening index.php. Did I perhaps miss some important settings in the byzantine cPanel menu page?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >