[PHP] Dependency Injection containers
Hi, I am trying to avoid reinventing the wheel so I am looking for dependency injection containers that work with PHP 5.2. So Symphony2 and ZF2 DI are out of question. I found this http://www.potstuck.com/2010/09/09/php-dependency-a-php-dependency-injection-framework/ but I was wondering if anyone has a opinion about it or alternatives. regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Anyone has mcrypt working with Zend Community Edition and Mac OS X Lion?
Hi, After I've upgraded it stopped working and even if I reinstall the Zend CE package it complains. Regards.
[PHP] Problems with interoperability: MCrypt AES PHP x Java
Hi, I am having problems while trying to decrypt an encrypted string (generated from a java system) in PHP. To take external factors out of the way I decided to make them work first in my local system. So I've created a sample encrypt/decrypt from PHP (using mcrypt's extension) and the java code found at http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html. I've added a System.out.println(KEY: + asHex(raw)); to get the key used in the java and set the same in PHP. There is no mention in Java but since I didn't see a initialization vector I assume we are use ECB mode. Unfortunately the same string /key produces different encrypted values.
[PHP] Understanding deprecated features from 5.2 - 5.3
Hi, I am planning to upgrade my server from 5.2 to 5.3 but I am not sure if the deprecated features will simply throw warning messages but work or won't work at all. So far I've read that deprecated features are going to be removed on later versions. Unfortunately I host sites and some may use features like register_globals and I need to know what to expect.
[PHP] Online tests for php
Hi, I am trying to hire some php developers for a local taks and I need to somehow perform a triage. One of the aspects is the knowledge of PHP itself so I was wondering if there is any set of questions (multiple choice) to try to do that. I am not looking for a certification level in those tests but a way to at least know what this guy knows.
[PHP] unable to allocate memory for pool (php 5.2.16)
Hi, My system got upgraded with the rpm version of php 5.2.16 and since them I am getting errors with 'Unable to allocate memory for pool'. Reverting php to the older version solves the problem and while using the 5.2.16 the problems does not seem to occur with a specific pattern, i.e sometimes the same page works sometimes doesn't. Any idea or similar results?
Re: [PHP] Problems converting strings with 0 to integer
Hi, The core of the code is simply $fp = fopen('file.tab', 'rb'); while(!feof($fp)) { $line = fgets($fp); $data = explode(\t, $line); ... } So I try to manipulate the $data[X]. For example $data[0] is supposed to be numeric so I $n = (int) $data[0] One other thing if the second column should contain a string. If I check the string visually it is correct but a if( $data[1] == 'stringX') is false even if in the file I can see this (and print those two) I even did a md5 of both and they are different. I seems to be an encoding issue. Is it safe to use explode with utf8 strings? I even tried this code but no match found (jst to replace the explode) $str = abc 文字化けefg; $results = array(); preg_match_all(/\t/u, $str, $results); var_dump($results[0]); (I am sending this again without the reply because the first email was refused for some reason)
[PHP] Problems converting strings with 0 to integer
Hi, I have a text file (utf-8 encoded) which contains lines with numbers and text separated by \t. I need to convert the numbers that contains 0 (at left) to integers. For some reason one line that contains 0002 is casted to 0 instead of 2. Bellow the output of the cast (int) $field[0] where I get this from explode each line. 0 0002 4 0004
[PHP] Invalid chars in XML
Hi, I am trying to parse a XML file with simplexml_load but it gave me error. While inspecting the contents I found a inside the value of a tag. tagsomething something/tag. After I've removed the everything went fine. So which chars I should not put in my file? Should I use some conversion function like html_entities? Does the receiver of the XML has to do anything to convert is back?
Re: [PHP] Problem with SOAP and authentication? SoapFault exception: [HTTP] Unauthorized
I was hoping for a userland soap library (like nuSoap if I understand correctly). I can't change the fact that the remote webservice requires http auth. Hopefully someone in this list uses either zend_soap or soapClient directly with auth to confirm or deny that the problem is in this part specifically. On Tue, Jun 29, 2010 at 7:23 AM, Richard Quadling rquadl...@gmail.comwrote: On 28 June 2010 22:37, robert mena robert.m...@gmail.com wrote: Hi, I'll have a look. I am using Zend Framework's Zend_Soap_Client which in turn uses SoapClient. I'll try to use SoapClient directly. I am not using https and I am not going through a proxy (using a non standard port). I've tested with another SOAP client (a standalone application called SoapUI) without a problem. Is there anyone using SoapClient (or Zend_Soap_Client) with auth with success? What other library (that does not use SoapClient) could I try? On Mon, Jun 28, 2010 at 6:27 AM, Richard Quadling rquadl...@gmail.com wrote: On 26 June 2010 23:46, robert mena robert.m...@gmail.com wrote: Hi, I am trying to access a webservice using php's soapclient but I keep getting the error SoapFault exception: [HTTP] Unauthorized If I try using a web browser I can authenticate using the same credentials used by the php code. I've searched but the only mention that I found led to a 'won't fix' bug registered to php 5.1.6. I am using 5.2.10. Any ideas of what may be causing this? Is there a workaround? Regards. Can you show the SoapClient construction you are using? The documentation says that you can supply HTTP authentication [1] ... For HTTP authentication, the login and password options can be used to supply credentials. For making an HTTP connection through a proxy server, the options proxy_host, proxy_port, proxy_login and proxy_password are also available. For HTTPS client certificate authentication use local_cert and passphrase options. An authentication may be supplied in the authentication option. The authentication method may be either SOAP_AUTHENTICATION_BASIC (default) or SOAP_AUTHENTICATION_DIGEST. There was recent activity on a Soap Authorisation Header bug [2]. If this issue is appropriate, you can try a building your code code from SVN (no win32 snapshots for a LONG time now). Regards, Richard. [1] http://docs.php.net/manual/en/soapclient.soapclient.php [2] http://bugs.php.net/bug.php?id=50976 -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling You can, of course, do it all yourself with cURL or sockets, but I believe the overhead would be significant. I think in the first instance, can we see the code you are using to make the request? I use the Zend_Soap_[Client|Server|WSDL|AutoDiscovery] but not with external Auth (like you are wanting). Instead, one of my services is the auth service (username is sent plain text and password is sent MD5 with a nonce - I believe the principle is sound. I chose this as I was being REALLY lazy in not learning about how to do Auth any other way. Richard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling
Re: [PHP] Problem with SOAP and authentication? SoapFault exception: [HTTP] Unauthorized
Hi Richard, Thanks for taking the time. Unfortunately I can't give you access to the actual webservice. I am using Zend_Soap_Client so my code is like this $soapOptions = array( login = 'xxx', password = 'y'); $client = new Zend_Soap_Client('http://myproviders.com/wsdl.xml', $soapOptions); $rc = $client-mi_request($var); I get PHP Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php:987 Stack trace: #0 [internal function]: SoapClient-__doRequest('?xml version=...', ' http://10.200', 'http://sap.com/...', 2) #1 /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php(987): call_user_func(Array, '?xml version=...', 'http://10.200', ' http://sap.com/...', 2) #2 [internal function]: Zend_Soap_Client-_doRequest(Object(Zend_Soap_Client_Common), '?xml version=...', 'http://10.200', 'http://sap.com/...', 2, 0) #3 /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client/Common.php(70): call_user_func(Array, Object(Zend_Soap_Client_Common), '?xml version=...', 'http://10.200', 'http://sap.com/...', 2, 0) #4 [internal function]: Zend_Soap_Client_Common-__doRequest('?xml version=...', 'http://10.200', 'http://sap.com/...', 2, 0) #5 /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php(1113): SoapClient-__soapCall('mi_request_ in /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php on line 987 Calling the SoapClient directly gives me the same result. On Tue, Jun 29, 2010 at 9:41 AM, Richard Quadling rquadl...@gmail.comwrote: On 29 June 2010 13:58, robert mena robert.m...@gmail.com wrote: I was hoping for a userland soap library (like nuSoap if I understand correctly). I can't change the fact that the remote webservice requires http auth. Hopefully someone in this list uses either zend_soap or soapClient directly with auth to confirm or deny that the problem is in this part specifically. On Tue, Jun 29, 2010 at 7:23 AM, Richard Quadling rquadl...@gmail.com wrote: On 28 June 2010 22:37, robert mena robert.m...@gmail.com wrote: Hi, I'll have a look. I am using Zend Framework's Zend_Soap_Client which in turn uses SoapClient. I'll try to use SoapClient directly. I am not using https and I am not going through a proxy (using a non standard port). I've tested with another SOAP client (a standalone application called SoapUI) without a problem. Is there anyone using SoapClient (or Zend_Soap_Client) with auth with success? What other library (that does not use SoapClient) could I try? On Mon, Jun 28, 2010 at 6:27 AM, Richard Quadling rquadl...@gmail.com wrote: On 26 June 2010 23:46, robert mena robert.m...@gmail.com wrote: Hi, I am trying to access a webservice using php's soapclient but I keep getting the error SoapFault exception: [HTTP] Unauthorized If I try using a web browser I can authenticate using the same credentials used by the php code. I've searched but the only mention that I found led to a 'won't fix' bug registered to php 5.1.6. I am using 5.2.10. Any ideas of what may be causing this? Is there a workaround? Regards. Can you show the SoapClient construction you are using? The documentation says that you can supply HTTP authentication [1] ... For HTTP authentication, the login and password options can be used to supply credentials. For making an HTTP connection through a proxy server, the options proxy_host, proxy_port, proxy_login and proxy_password are also available. For HTTPS client certificate authentication use local_cert and passphrase options. An authentication may be supplied in the authentication option. The authentication method may be either SOAP_AUTHENTICATION_BASIC (default) or SOAP_AUTHENTICATION_DIGEST. There was recent activity on a Soap Authorisation Header bug [2]. If this issue is appropriate, you can try a building your code code from SVN (no win32 snapshots for a LONG time now). Regards, Richard. [1] http://docs.php.net/manual/en/soapclient.soapclient.php [2] http://bugs.php.net/bug.php?id=50976 -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling You can, of course, do it all yourself with cURL or sockets, but I believe the overhead would be significant. I think in the first instance, can we see the code you are using to make the request? I use the Zend_Soap_[Client|Server|WSDL|AutoDiscovery] but not with external Auth (like you are wanting). Instead, one of my services is the auth service (username
Re: [PHP] Problem with SOAP and authentication? SoapFault exception: [HTTP] Unauthorized
Hi, I am using soapUI which is a client soap tester (that works with this webservice) to compare what is being generated. In the header I see Authorization: Basic =XYS So the default (using SoapClient) should also work... I've captured the tcpdump file and will try to load using wireshark. On Tue, Jun 29, 2010 at 5:18 PM, Richard Quadling rquadl...@gmail.comwrote: On 29 June 2010 20:53, robert mena robert.m...@gmail.com wrote: Hi Richard, Thanks for taking the time. Unfortunately I can't give you access to the actual webservice. I am using Zend_Soap_Client so my code is like this $soapOptions = array( login = 'xxx', password = 'y'); $client = new Zend_Soap_Client('http://myproviders.com/wsdl.xml', $soapOptions); $rc = $client-mi_request($var); I get PHP Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php:987 Stack trace: #0 [internal function]: SoapClient-__doRequest('?xml version=...', 'http://10.200', 'http://sap.com/...', 2) #1 /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php(987): call_user_func(Array, '?xml version=...', 'http://10.200', 'http://sap.com/...', 2) #2 [internal function]: Zend_Soap_Client-_doRequest(Object(Zend_Soap_Client_Common), '?xml version=...', 'http://10.200', 'http://sap.com/...', 2, 0) #3 /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client/Common.php(70): call_user_func(Array, Object(Zend_Soap_Client_Common), '?xml version=...', 'http://10.200', 'http://sap.com/...', 2, 0) #4 [internal function]: Zend_Soap_Client_Common-__doRequest('?xml version=...', 'http://10.200', 'http://sap.com/...', 2, 0) #5 /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php(1113): SoapClient-__soapCall('mi_request_ in /usr/local/zend/share/ZendFramework/library/Zend/Soap/Client.php on line 987 Calling the SoapClient directly gives me the same result. On Tue, Jun 29, 2010 at 9:41 AM, Richard Quadling rquadl...@gmail.com wrote: On 29 June 2010 13:58, robert mena robert.m...@gmail.com wrote: I was hoping for a userland soap library (like nuSoap if I understand correctly). I can't change the fact that the remote webservice requires http auth. Hopefully someone in this list uses either zend_soap or soapClient directly with auth to confirm or deny that the problem is in this part specifically. On Tue, Jun 29, 2010 at 7:23 AM, Richard Quadling rquadl...@gmail.com wrote: On 28 June 2010 22:37, robert mena robert.m...@gmail.com wrote: Hi, I'll have a look. I am using Zend Framework's Zend_Soap_Client which in turn uses SoapClient. I'll try to use SoapClient directly. I am not using https and I am not going through a proxy (using a non standard port). I've tested with another SOAP client (a standalone application called SoapUI) without a problem. Is there anyone using SoapClient (or Zend_Soap_Client) with auth with success? What other library (that does not use SoapClient) could I try? On Mon, Jun 28, 2010 at 6:27 AM, Richard Quadling rquadl...@gmail.com wrote: On 26 June 2010 23:46, robert mena robert.m...@gmail.com wrote: Hi, I am trying to access a webservice using php's soapclient but I keep getting the error SoapFault exception: [HTTP] Unauthorized If I try using a web browser I can authenticate using the same credentials used by the php code. I've searched but the only mention that I found led to a 'won't fix' bug registered to php 5.1.6. I am using 5.2.10. Any ideas of what may be causing this? Is there a workaround? Regards. Can you show the SoapClient construction you are using? The documentation says that you can supply HTTP authentication [1] ... For HTTP authentication, the login and password options can be used to supply credentials. For making an HTTP connection through a proxy server, the options proxy_host, proxy_port, proxy_login and proxy_password are also available. For HTTPS client certificate authentication use local_cert and passphrase options. An authentication may be supplied in the authentication option. The authentication method may be either SOAP_AUTHENTICATION_BASIC (default) or SOAP_AUTHENTICATION_DIGEST. There was recent activity on a Soap Authorisation Header bug [2]. If this issue is appropriate, you can try a building your code code from SVN (no win32 snapshots for a LONG time now). Regards, Richard. [1] http://docs.php.net/manual/en/soapclient.soapclient.php [2] http://bugs.php.net/bug.php?id=50976 -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http
Re: [PHP] Problem with SOAP and authentication? SoapFault exception: [HTTP] Unauthorized
Hi, I'll have a look. I am using Zend Framework's Zend_Soap_Client which in turn uses SoapClient. I'll try to use SoapClient directly. I am not using https and I am not going through a proxy (using a non standard port). I've tested with another SOAP client (a standalone application called SoapUI) without a problem. Is there anyone using SoapClient (or Zend_Soap_Client) with auth with success? What other library (that does not use SoapClient) could I try? On Mon, Jun 28, 2010 at 6:27 AM, Richard Quadling rquadl...@gmail.comwrote: On 26 June 2010 23:46, robert mena robert.m...@gmail.com wrote: Hi, I am trying to access a webservice using php's soapclient but I keep getting the error SoapFault exception: [HTTP] Unauthorized If I try using a web browser I can authenticate using the same credentials used by the php code. I've searched but the only mention that I found led to a 'won't fix' bug registered to php 5.1.6. I am using 5.2.10. Any ideas of what may be causing this? Is there a workaround? Regards. Can you show the SoapClient construction you are using? The documentation says that you can supply HTTP authentication [1] ... For HTTP authentication, the login and password options can be used to supply credentials. For making an HTTP connection through a proxy server, the options proxy_host, proxy_port, proxy_login and proxy_password are also available. For HTTPS client certificate authentication use local_cert and passphrase options. An authentication may be supplied in the authentication option. The authentication method may be either SOAP_AUTHENTICATION_BASIC (default) or SOAP_AUTHENTICATION_DIGEST. There was recent activity on a Soap Authorisation Header bug [2]. If this issue is appropriate, you can try a building your code code from SVN (no win32 snapshots for a LONG time now). Regards, Richard. [1] http://docs.php.net/manual/en/soapclient.soapclient.php [2] http://bugs.php.net/bug.php?id=50976 -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling
[PHP] Using array_intersect with an unknown number of arrays
Hi, I have a result set coming from a database that can be of the form below $lines = array(0 = array('idA' = 1, 'idU' = 1), 1 = array('idA' = 1, 'idU' = 2), 2 = array('idA' = 2, 'idU' = 1), 3 = array('idA' = 2, 'idU' = 2), 4 = array('idA' = 3, 'idU' = 1), 5 = array('idA' = 3, 'idU' = 2)); I used the code to generate arrays based on the idA, i.e, one array containing all the idU from each idA foreach ($lines as $r) { if(!isset($list[$r['idA']])) { $list[$r['idA']] = array(); } array_push($list[$r['idA']], $r['idU']); } Now need just the idU that occurs in all. In my example I could simply $x = array_intersect($list[1], $list[2], $list[3]); This works but the problem is that I do not know in advance how many (and which) indexes I will get from that foreach since the results will differ from the database. Is there a way around this ?
[PHP] Help with security configuration for a shared hosting environment
Hi, I am setting a shared hosting server and I'd like to gather some advices regarding the security. Since the code will not be produced by me I'd like to focus on environment strategies. For now I've added a noexec in the mount options of the /tmp and the homedir of the web server, disabled the devel tools (such as gcc). In terms of the PHP I am inclined to use mod_suPHP to avoid having the problem with the script generated files (such as uploads) being owned by the webserver itself and I'd like to use the available php.ini options to try to make it harder for an attacker to cause problems. I will disable the register_globals and the allow url fopen. But what else can I do (open_basedir/doc_root/safe_mode etc)? I need to allow the user to access the pear classes. Using linux/php 5.2.x Regards.
[PHP] Unable to get output from exec ssh remote-server 'ping -c4 ip'
Hi, I need to develop an interface that will, for example, ping IPs from a remote server. So the php script will be hosted in a server with ssh access (key) to the remote server. I can make it work from the console but when I try $cmd = ssh remote-server 'ping -c 4 ip' exec($cmd, $ouput); the output is empty. the same command (with the remote-server and IP changed to the real ones) works fine from command line. I've added the key/config in the webserver's user .ssh directory so I am assuming that that there is something wrong with my setup. any ideas?
[PHP] Searching MySQL with Japanese chars
Hi, I am developing my first application that will have to handle with japanese data stored in a MySQL database. After digging a while it seems that I'd have to set all pieces (from the charset of the apache, to the encoding of the templates and database fields) set to UTF-8. I'd like to know if there is something special that I have to be aware when doing searches. I am not sure that this is more related to PHP or MySQL itself so before sending to them (MySQL list) I'd like to hear from you. Thanks.
[PHP] Corrupted ZIP files (downloaded via a php script) : Internext Explorer 7
Hi, I have a set of files stored in a directory and I need to serve those via a php script (in order to protect, control access etc). The problem is that zip files (exe also) get corrupted when I try from IE7. I've read the posts from this list and google etc with no idea of how to solve it. The stored files are ok (tested from firefox or direct copy). When I use IE7 the file size is smaller. In my test a config.zip with 248 bytes ends up with 214 bytes. This is the code used header(Pragma: public); header('Expires: '.gmdate('D, d M Y H:i:s').' GMT'); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); header(Cache-Control: private,false); header(Content-Type: .$type); if($remove_date_from_file == false) header('Content-Disposition: attachment; filename='.basename($file).''); else { $name_ = substr(basename($file),0,strrpos(basename($file),.)); $ext_ = substr(basename($file),strrpos(basename($file),.)); $new_name_ = substr($name_,0,strlen($name_)-15).$ext_; header('Content-Disposition: attachment; filename='.$new_name_.''); } header(Content-Transfer-Encoding: binary); header('Content-Length: '.filesize($file)); while(!feof($fp)) { echo fgets($fp) ; } fclose($fp); I've added a debug to send me a message with the header and it comes the same way no matter what browser. Pragma: public Expires: Wed, 16 Jul 2008 23:12:00 GMT Cache-Control: must-revalidate, post-check=0, pre-check=0 Cache-Control: private Content-Type: application/zip Content-Disposition: attachment; filename=config.zip Content-Transfer-Encoding: binary Content-Length: 248 Am I doing something wrong or do I have to start looking to the server's configuration (like mod_deflate)?
[PHP] PHP and SAP
Hi, I'd like to know if there are any tutorials about SAP and PHP. I'm moving to a new company and there is the need to provide some sort of access to internet/intranet to resources available in SAP. Since I work with PHP I am wondering what kind of support, tips, info I can get in order to decided if it is the best language or the alternatives. regards.
Re: [PHP] Improving development process / help with developer setup
Hi, Thanks for all answers. Please let me add that I do use CVS (migrating to SVN) and the reason to use samba is that doing this allows the developer machine (windows) to access the shares hosted in a linux server so when he/she tests it will be run in the 'same' environment that the staging and production servers and because in order to assure browser compatibility they have to test from firefox/IE. So, in order to allow phpunit to be ran, have the firefox/IE support and use xdebug I have two basic options: a) stay with windows, install XAMPP (or any other all-in-one). And live with the fact that some things will have to be taken care of (such as PATH differences between unix/windows) b) switch to linux with the development stack, enable a windows server to be connected from rdesktop so they can test the IE In both cases I'll have extra work in order to maintain the developer's machine somewhat synchronized with the production server. Am I missing a third/fourth (better) etc option? thanks. On Sat, May 10, 2008 at 8:44 PM, Gabriel Sosa [EMAIL PROTECTED] wrote: I suggest you if you are running live on linux, then developing on linux, could be the same dist or not.. but definitely don't mix OS, because the extensions could fail, etc. one big issue it's the case insensitive in windows. definitely some version control system such as SVN or GIT you can use Hudson for continuous integration and selenium for automatics QA test over browsers again, try to don't mix OS. saludos gabriel On Sat, May 10, 2008 at 1:44 PM, David Otton [EMAIL PROTECTED] wrote: 2008/5/10 robert mena [EMAIL PROTECTED]: I am looking for tips regarding improving the development process. I'll explain my current setup and please feel free to comment. My developers all use windows + eclipse PDT, the workspace is hosted (via samba) in a Linux server with Apache/PHP/MySQL. I am in the process of adopting Unit testing (PHPUnit2) and debug (Xdebug) so I have concerns about how to property use this. For example, in my current setup I'd have to enable SSH so they could run the tests from the command line in the development server, but I am not sure if I could remotely use Xdebug. Your description (specifically, Samba) suggests that you're not using source control. If you want to go for TDD (I don't know that you do, but IMO it's a good direction to move in) I would suggest a three-server setup - dev, staging and live. The dev server(s) are where you work. One per developer. Once you're happy with your code and your tests, you commit your changes to source control. This is where it gets clever. You can use pre- and post-commit hooks to run an automated build process that pushes the changes to a staging server, automatically runs the unit tests, and accepts/rejects the commits based on the test results. You can even lint the code, and reject anything that isn't in the house style. With larger projects, where an entire publish-and-test on each commit becomes impractical, you can just run the build process and unit tests every n hours, and mail out the results. Publishing to the live server is simply a matter of running the build scripts with a different destination. On top of all that, run an issue tracker. /Everything/ goes in the issue tracker, bugs, features, whatever. When you make a commit, that commit should be closing an issue in the issue tracker (via commit hooks again). That way you can track each change that's been made back to its reason. All of this is opinion, of course, there's no Right Way. Just take what's useful to you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Los sabios buscan la sabiduría; los necios creen haberla encontrado. Gabriel Sosa
Re: [PHP] Improving development process / help with developer setup
Hi Zoltan, If the windows would be used just for IE I think it's cheaper to have one windows machine (server 2003/2008), have the users connect via terminal service (rdesktop). I think it's easier than having to install/maintain than multiple windows installations, even if it is a virtual machine. why not switch everything to linux and run IE in wine or vmware on the developer's machine? that way you don't have to maintain windows machines at all greets, Zoltán Németh
Re: [PHP] Improving development process / help with developer setup
Unfortunately this is not an option due to budget :) I use Mac myself (with VMWare fusion) but would not be feasible to depoly this with all the devel team. Or depending on your budget, Switch the developers to Macintosh computers, install windows via parallels, and then you can test in Mac/Unix/Windows all from 1 computer :)
[PHP] Improving development process / help with developer setup
Hi, I am looking for tips regarding improving the development process. I'll explain my current setup and please feel free to comment. My developers all use windows + eclipse PDT, the workspace is hosted (via samba) in a Linux server with Apache/PHP/MySQL. I am in the process of adopting Unit testing (PHPUnit2) and debug (Xdebug) so I have concerns about how to property use this. For example, in my current setup I'd have to enable SSH so they could run the tests from the command line in the development server, but I am not sure if I could remotely use Xdebug. Thanks.
[PHP] Help securing a server : Owned by W4n73d H4ck3r
Hi, One server that hosts several domains ended up with the message Owned by W4n73d H4ck3r.While still performing an audit I am very confident that this was caused by a php script (it is a linux server) uploaded via FTP or by a defective site hosted (perhaps vulnerable version of a CMS). The symptons seem clear, files owned by apache are vulnerable and the attacker script scanned the web tree and started running. So, basically two questions: - how to detect where this came from - how to prevent it from happening again Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help securing a server : Owned by W4n73d H4ck3r
Hi Daniel, Thanks for the reply. I agree that there are steps that go outside php scope (chroot apache etc) but I think this partially belongs to this list specially since google shows that the same message (perhaps a copycat?) appears in tons of sites. I was hoping that someone already had tips regarding the php part (like disabling some functions etc). But since I am also copying you directly please feel free to email me privately. Thanks again. On Nov 9, 2007 11:41 AM, Daniel Brown [EMAIL PROTECTED] wrote: On Nov 9, 2007 9:27 AM, robert mena [EMAIL PROTECTED] wrote: Hi, One server that hosts several domains ended up with the message Owned by W4n73d H4ck3r.While still performing an audit I am very confident that this was caused by a php script (it is a linux server) uploaded via FTP or by a defective site hosted (perhaps vulnerable version of a CMS). The symptons seem clear, files owned by apache are vulnerable and the attacker script scanned the web tree and started running. So, basically two questions: - how to detect where this came from - how to prevent it from happening again Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Robert, That's really not so much a PHP question, but a general Linux security question. Primarily, my job is computer forensics and security, so if you'd like, you can reply to me off-list and I'll be glad to offer you a hand. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help securing a server : Owned by W4n73d H4ck3r
Hi Daniel, According to the audit this happened yesterday. I am searching astalavista but could not find anything, probably because I am being too specific. From the php side (or closely) what steps would you recommend in order to have a better security? I could not find a consistent 'list' of configuration settings to disable or change besides the register_globals. From the system side my list so far includes (some already in place previous) - no devel tools installed on the server (gcc etc) - /tmp mounted with no_exec - chroot apache - use mod_security Thanks. It's all good. We go off on tangents enough here anyway, so I suppose one more wouldn't hurt. ;-P The person doing this seems to be relatively new to the scene, only defacing websites with common vulnerabilities that you can find anywhere on the Internet (http://astalavista.box.sk/ for example). Check out Zone-H (http://www.zone-h.net/) to see if your domains are on there, and to see if you can build a pattern from his/her past exploits. That should help you in determining how he/she is doing it. You're on the right track in guessing that it was CMS-related. Remember how many sites and servers were compromised when phpBB exploits were announced and left unpatched? These jackass skript kiddies just Google for known versions and deface whatever they can. It's not like the old days where you picked a target and found a way in now it's just that you pick your way in and find a target. *yawn!* No challenge anymore these kids are too lazy -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Loosing session data between requests
Hi, I am facing a strange problem. I have two servers (both Centos 4.5, httpd 2.0.52, php 5.1.6) and in one of them a webmail (uebimiau) looses session data between requests and in another it does not. I've compared php.ini from both with nothing different except for some memory limits they are equal. I've checked both /tmp and the session file sess_x in one server is empty and in another has the data. Both $_SESSION are ok (I've checked with a var_dump). What could it be? thanks.
Re: [PHP] Loosing session data between requests
Edward, My session.save_path = /tmp. The sess_X is created but with no contents On 9/6/07, Edward Kay [EMAIL PROTECTED] wrote: robert mena wrote: I've checked both /tmp and the session file sess_x in one server is empty and in another has the data. Both $_SESSION are ok (I've checked with a var_dump). Check the permissions on /var/lib/php/session Edward
[PHP] Live support system (in php)
Hi, I am looking for solutions to enable live support in my websites. I was told that phplivesupport (http://www.phplivesupport.com/) is a good solution but it seems to be dead (no anwser to emails, always offline). Does anybody have another solution (with source code available) within the same price range? (US$100). thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Which Chat system to use
Hi zerof, Thanks for the reply. Unfortunately the chat you've suggested does not have one basic need that is private chats (via separate channels). This way a user chatting in the room will be able to send direct messages with others. Any other tips? On 8/4/07, zerof [EMAIL PROTECTED] wrote: robert mena escreveu: Hi, I need to add a simple chat system to my site and I am trying to find out good solutions, free or paid. Some of the requirements : - php :) - uses some sort of template system (smarty better) - support for private chats - source code available - one chat room (except for private chats everybody sees everything) So far the chat systems I've found are too complex (need to register the nick before entering the chat, confusing interface), not stable enough ( http://www.phpfreechat.net/) or integrated with other systems. There is no need for : - multiple chat rooms - operator/ban - registration of the nickname - archive of previous chats thanks. -- http://socket7.net/lace/ -- zerof http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management -- You must hear, always, one second opinion! In all cases. -- Let the people know if this info was useful for you! -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Which Chat system to use
Hi, I need to add a simple chat system to my site and I am trying to find out good solutions, free or paid. Some of the requirements : - php :) - uses some sort of template system (smarty better) - support for private chats - source code available - one chat room (except for private chats everybody sees everything) So far the chat systems I've found are too complex (need to register the nick before entering the chat, confusing interface), not stable enough ( http://www.phpfreechat.net/) or integrated with other systems. There is no need for : - multiple chat rooms - operator/ban - registration of the nickname - archive of previous chats thanks.
[PHP] Chat system
Hi, I am looking for a simple php chat system (no registration, no private channels). Unfortunately the ones I've found (phpopenchat, phpfreechat) are too complicate, requiring the user to register or fail to work properly in IE6 or IE7. Any tips? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chat system
Hi Daniel, Thanks. How can the user chooses the nickname? How about the list of connected users? On 6/19/07, Daniel Brown [EMAIL PROTECTED] wrote: On 6/19/07, robert mena [EMAIL PROTECTED] wrote: Hi, I am looking for a simple php chat system (no registration, no private channels). Unfortunately the ones I've found (phpopenchat, phpfreechat) are too complicate, requiring the user to register or fail to work properly in IE6 or IE7. Any tips? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I have a one that I started putting together a few days ago that uses AJAX. It can accept user registration, multiple rooms, et cetera, but unless the files are included with the distribution, it's a single room without registration. Check it out: http://www.pilotpig.net/gchat/ -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Tipos about which CMS use
Hi, Thanks for the reply. I already use wordpress for my blog but not as a CMS. I could not find, for instance, the hability to create users with some sort of priviledge regarding reading/writing particular documents or areas. Can you send me more info about it? On 5/17/07, itoctopus [EMAIL PROTECTED] wrote: I've said it before and I'll say it again: Wordpress. Joomla/Mambo are also a good choice. -- itoctopus - http://www.itoctopus.com robert mena [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, I'd like to replace my 'intranet' site with a CMS system to speed up the edit process. Some of my requirements are : - written in PHP :) - mysql based - documented/'well structured' - to allow development of customizations - ability to define which pages or sections are public and which are private (and in this case which users can access) - use AJAX (not mandatory) but since some access to the page will come from dial-up to reduce the need to transfer entire html just to update a search or list contents.. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Tipos about which CMS use
Hi there, I'd like to replace my 'intranet' site with a CMS system to speed up the edit process. Some of my requirements are : - written in PHP :) - mysql based - documented/'well structured' - to allow development of customizations - ability to define which pages or sections are public and which are private (and in this case which users can access) - use AJAX (not mandatory) but since some access to the page will come from dial-up to reduce the need to transfer entire html just to update a search or list contents.. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Printing library in PHP ?
Boban, I do not know what noobie is but thanks for the reply. I know that the effect I want can be achieved using CSS but the question was there is a printing llibrary so some of the trouble would be solved by this library and not myself On 3/14/06, Bogdan Ribic [EMAIL PROTECTED] wrote: This is more of an HTML question than it has to do with PHP, and you sound like a noobie :) Only useful info I can give you is to use THEAD in tables to hold headers, browsers put that row first on every page when breaking large table on several pages. Boban. robert mena wrote: For example: I have a specific report I have to add a header to each page I have another one with tabular data that when the result is larger than a page I should break the table and start at the next page so the table headers can be seen again... In both I'd need a way to decide/find out how many pages will be necessary (given the size of the paper sheet) so I could generate the HTML correctly. -- Open source PHP code generator for DB operations http://sourceforge.net/projects/bfrcg/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Printing library in PHP ?
Hi Burhan, Thanks. I'll try that but even tough my clients now uses windows I generally do not like to be too commited to a single platform. -rm On 3/15/06, Burhan [EMAIL PROTECTED] wrote: robert mena wrote: Hi Manuel, I am trying to print from the client side. The client will be windows. Use ActiveX if you can get them to stick with IE (shouldn't be a problem). Google for 'ScriptX.cab' -- a free printing control that lets to fine tune printing.
Re: [PHP] Printing library in PHP ?
Hi Steve, This seems to be a good alternative. I've found pdflib($), ezPDF (dead?) e this fpdf as different ways to generate pdf. One drawback is that I'd have to construct all my documents 'by hand'. For trully dynamic this is no problem but for those that only differs at the name of the client that would represent too much work for a little gain. After some research it seems that there is a tool called docbook that allows me to convert it's format (a XML based?) into a lot of things, PDF included. Well, I have two ways now: - use a pdf library for those dynamic reports - convert my word documents into docbook (using an editor), put some placeholders and using PHP to replace the placeholders with actual data (such as name, price) and call docbook to generate the pdf. - rm On 3/14/06, Steve Brown [EMAIL PROTECTED] wrote: I am currently migrating an application originally written with Delphi to PHP. Everything is going fine except the printing of the reports that does not produce the same visual result (i.e does not look the same or has some aligmment issues). We generate all of our printed reports using FPDF (http://www.fpdf.org) to generate PDF files. Its very flexible, can do must of what you are aksing for, and unlike some alternatives, its free.PDFs are going to be the easiest way to get total control of the output. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Security in php/ajax scripts
Hi, I am slowly converting my webapps to use the 'ajax' technology. I'd like to know what 'best practices' should I use when it comes to authenticate, identify the requests in a more restricted context. So far I've migrated some 'open' areas where the user, without having to identify himself can perform searches. But I need to allow/deny him to do insert/delete/update actions. In the traditional webapp I'd create a login page where the user. password would be checked against a database and a session variable would be set with a authenticate code. Further access to restricted pages are allowed/denied based on the existance of this authenticate code. What would be a good alternative in my ajax-enabled webapp? I cant use session in my php scripts (those called by the XMLHttpRequest.open) right?
[PHP] Re: Printing library in PHP ?
Hi Manuel, I am trying to print from the client side. The client will be windows. Thanks. On 3/13/06, Manuel Lemos [EMAIL PROTECTED] wrote: Hello, on 03/13/2006 09:44 AM robert mena said the following: I am currently migrating an application originally written with Delphi to PHP. Everything is going fine except the printing of the reports that does not produce the same visual result (i.e does not look the same or has some aligmment issues). From what I've read I should use CSS to achieve such result but I was wondering if there is any toolkit, library in PHP that would ease my work. For example: I have a specific report I have to add a header to each page I have another one with tabular data that when the result is larger than a page I should break the table and start at the next page so the table headers can be seen again... In both I'd need a way to decide/find out how many pages will be necessary (given the size of the paper sheet) so I could generate the HTML correctly. You did not mention the platform you want to print, nor if you want to print on the client side or server side. If you want to print on the server side, you may want to take a look at this IPP (Internet Printing Protocol) client class that can be used to print HTML documents on Windows and Linux (with CUPS). http://www.phpclasses.org/printipp -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/
[PHP] Printing library in PHP ?
Hi, I am currently migrating an application originally written with Delphi to PHP. Everything is going fine except the printing of the reports that does not produce the same visual result (i.e does not look the same or has some aligmment issues). From what I've read I should use CSS to achieve such result but I was wondering if there is any toolkit, library in PHP that would ease my work. For example: I have a specific report I have to add a header to each page I have another one with tabular data that when the result is larger than a page I should break the table and start at the next page so the table headers can be seen again... In both I'd need a way to decide/find out how many pages will be necessary (given the size of the paper sheet) so I could generate the HTML correctly.
[PHP] include not working properly?
Hi, I am facing a strange problem. One of my classes uses a include(Log.php) to enable to to use the Log class that comes with pear. *Fatal error*: require_once() [function.requirehttp://www.manaushoteis.tur.br/function.require]: Failed opening required 'Log.php' (include_path='.:/usr/local/lib/php/:/home/httpd/html/php/:/home/httpd/html/include/php/') in */var/www/html/domain/php/Conexion.inc* on line *14* ** *I do have the Log.php* ** *ls -lsa /usr/local/lib/php/Log.php 20 -rw-r--r-- 1 root root 18563 Mai 25 2005 /usr/local/lib/php/Log.php* ** *My virtualhost* ** VirtualHost A.B.C.D:80 ServerAdmin [EMAIL PROTECTED] DocumentRoot /var/www/html/domain ServerName www.domain ErrorLog logs/domain-error_log CustomLog logs/domain-access_log combined ScriptAlias /cgi-bin/ /var/www/cgi-bin/ Directory /var/www/html/domain/ php_admin_value doc_root /var/www/html/domain/ php_admin_flag safe_mode off php_admin_value safe_mode_include_dir /var/www/html/domain/:/tmp/:/usr/local/lib/php php_admin_value open_basedir /var/www/html/domain/:/tmp/ php_admin_value safe_mode_exec_dir /var/www/php_exec_dir AllowOverride AuthConfig Limit /Directory /VirtualHost You will notice that the safe mode is off. It was originally on but the same error happened. I've even tryied using a include (/usr/local/lib/php/Log.php) with the same error. Any ideas? PHP Version 5.1.2 System Linux baco.argo.com.br 2.6.12-1.1381_FC3 #1 Fri Oct 21 03:46:55 EDT 2005 i686 Build Date Jan 31 2006 10:17:45 Configure Command './configure' '--with-mysql' '--with-gd' '--with-apxs2' '--with-xml' '--with-ftp' '--enable-session' '--enable-trans-sid' '--with-zlib' '--enable-inline-optimization' '--with-mcrypt=/usr/local' '--with-imap=/usr/include/imap' '--with-kerberos' '--enable-sigchild' '--with-gettext' '--with-freetype' '--with-ttf' '--with-ftp' '--enable-ftp' '--with-jpeg-dir=/usr' '--with-imap-ssl=/usr/include/openssl' '--with-xpm-dir=/usr/X11R6' '--enable-gd-native-ttf' '--with-png' '--with-freetype-dir=/usr' '--with-openssl=/usr' '--with-openssl-dir=/usr/' '--with-pgsql'
Re: [PHP] Controling buffer: php/smarty or apache?
Hi David, Thanks for the reply. I am aware of this 'browser' issue but it seems that it's not the case. I'll look again but since I do not use tables only divs/css I am running out of option on the html site. On 1/22/06, David Tulloh [EMAIL PROTECTED] wrote: The browsers use a whole bunch of different ways to figure out how it should render the page and if it should do it on the fly or wait until the page is fully downloaded. Assuming the content you are testing is the same for the static and dynamic pages you should probably start looking for little things that may be different. From what I've read, adding extra column information to the table tag and making sure the doctype is correct so you don't end up in quirks mode are both large factors. Using 'wget ---save-headers' and 'diff' will help you find any small difference between the pages. David robert mena wrote: Hi, I am facing a strange problem. My site, even tough designed to appear quickly at user's browser, appears at once. If I test the static HTML version it starts to appear as downloaded If I test the php generated version the page seems render as a whole. I am using smarty as a template and it seems to be related to a buffer somewhere: php/smarty or apache. I've used microtime and from the begin of the php script until after the smarty-display it takes from 0.05s (min) to 0.32s (max) Any tips of how can I figure out what is slowing down my site? tks
[PHP] Unable to compile php 5.1 / 5.1RC ok
Hi, I am trying to compile php 5.1 but it fails with pdo error messages './configure' '--with-apxs2' '--with-mysql=/usr' '--enable-soap' '--with-xmlrpc' --with-zlib --enable-pdo=shared --with-pdo-mysql=/usr ext/sqlite/.libs/sqlite.o(.text+0x1365): In function `zm_startup_sqlite': /home/build/php-5.1.0/ext/sqlite/sqlite.c:1100: undefined reference to `php_pdo_register_driver' ... collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 I do have sqlite/sqlite-devel installed. Linux / FC4 sqlite-3.1.2-3 sqlite-devel-3.1.2-3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Setup tips for oracle 9i development
hi, I'd like to start developing php applications that will access oracle 9i databases. I am trying to setup a development enviroment using Linux so I was wondering what should I download/install from oracle's web site in order to compile php with 9i support. I am assuming that there is some sort of devel package only with the libraries and headers... The database is already running (under Windows). regards, mena
[PHP] design pattern/code generators
Hi All, I am looking for advice regarding design patterns/code generation in PHP5. I have a simple code generation tool (written in PHP) to interface with database. It works fine for simple situations but seems a little strange for more complex ones. Suppose I have a table user (id, name, age) and a table account(idAccount, idUser, name). My generator creates a class for each table and a standard db class. Each class basically has a set/get method for each property and some standard insert, delete, update, search methods ex. class user { var $db function setName(..) function getName() function insert() { $this-db-query(insert into user values...) } ... } I've omited the other methods/constructor but you can get the picture. The problem comes when I have to access information the comes from 2+ tables. Suppose I have to show all users accounts. Now I end up with something like this. $u = new User() ; $a = new Account() ; if($u-search()) { for($i=0;$i...) { $idUser = $u-getId() ; $u-next() ; $a-setIdUser($idUser) ; if($a-search()) { // print } } While this works I feel there must be an easier/cleaner way. If I was just querying the database a join would give me the result in one pass. In my case what should I do ? create a new method showAccounts ? Where should I put it, in User or Account class ? I am interested in advices regarding how to design it better so I can make the proper adjustments in my generator. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search engine : build a new one or use an alreadry existing one ?
Hi, I need to improve my current search mecanism but got stuck in a dilema : build one or use an existing engine? My site, that uses php/smarty allows my users to browse products in a category listing or search. Currently my search only performs a 'select xxx from where field like ' and show the results. Even tough it works I'd like to improve it, showing the results by relevance, proper hadling mispelled words, performing the serach not only in the product's name etc. I've tried mnogosearch but I am not sure that I'll be able to manipulate the query results in order to show only results in the product section (not the entire site). Regards, rt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with php 4/5, segmentation fault
Hi, I have a Linux Fedora Core2 system with apache 2.0.51 and php installed. Recently I 've noticed that some pages stopped working. Those pages while accessed does not output anything. After some tests I noticed that the page comes back to live if I remove the mysql_pconnect call. I've tried to upgrade php (to 4.3.9 and even 5.0.2). The mysqlclient tool can connect with no problem. The test script is ?php error_reporting(E_ALL) ; echo HI ; if(mysql_pconnect(databasehost,user,pass)) { echo OK ; } else { echo NOT OK ; } ? If I access via http nothing appears. If I use the cli version I can connect. Regular html and php without db access work ok. I've even tryed to downgrade or reinstall apache to 2.0.50 or back to 2.0.51. Any ideas ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dinamic generate PDF : which way ? (classes, docbook)
Thanks. I'll check it out. My main concern is that what seems great about using those php classes to generate the pdf directly is the possibilite to pull data from mysql (or other db) and generate an up-to-date report. But since this is not the case seems a lot of work just to generate a simple table. I don't work with docbook yet so it can be a wrong feeling but seems easier to train a person which already uses HTML to code using docbook's tags than teach php/class. Specially if what I want does not involve fancy features. - rt On Mon, 6 Sep 2004 09:39:34 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello Robert, I would suggest that if your data is such that it can use DocBook, definitely go the DocBook route. You can also use Apache's Cocoon publish your DocBook content to PDF/HTML/RTF/SVG/TXT etc. Here are some samples that use Apache Cocoon to perform dynamic conversion to PDF/HTML: http://www.xml-dev.com/blog/#88 Here are some other utilities to convert to PDF: http://www.xml-dev.com/blog/#101 This one is pretty good: http://html2pdf.seven49.net/seven49.aspx? Thanks. Saqib Ali http://validate.sf.net robert mena [EMAIL PROTECTED] wrote on 09/06/2004 04:56:18 AM: Hi, I plan to dynamic generate some of the documents I need on a regular basis. Sometimes they only differ by the name of the company so my first attempt would be to generate templates in word and ask/replace for the values needed. I am evaluating the http://www.ros.co.nz/pdf/, www.fpdf.org and php classes that generate pdf and as another option use docbook to convert. I am not sure which way is better. From my point of view: a) Both classes seem to be fine but in order to generate (static) tables and other elements I will need a lot of programming calls/variables. So I'd have a manual and perhaps tedious/error procedure to convert the document into the programable-version of it. b) I do not have experience with DocBook (even tough I can code html and latex) but I could use an editor to generate the document with the tables, place images etc. Identify the template variables and call docbook to generate the pdf. I'd still have to manually convert the file but would not need a lot of calls to generate a table or even use a php programmer. I am assuming the the tags needed are more easly understanded than $pdf-addCell($data,width..) Any ideias ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dinamic generate PDF : which way ? (classes, docbook)
Hi, I plan to dynamic generate some of the documents I need on a regular basis. Sometimes they only differ by the name of the company so my first attempt would be to generate templates in word and ask/replace for the values needed. I am evaluating the http://www.ros.co.nz/pdf/, www.fpdf.org and php classes that generate pdf and as another option use docbook to convert. I am not sure which way is better. From my point of view: a) Both classes seem to be fine but in order to generate (static) tables and other elements I will need a lot of programming calls/variables. So I'd have a manual and perhaps tedious/error procedure to convert the document into the programable-version of it. b) I do not have experience with DocBook (even tough I can code html and latex) but I could use an editor to generate the document with the tables, place images etc. Identify the template variables and call docbook to generate the pdf. I'd still have to manually convert the file but would not need a lot of calls to generate a table or even use a php programmer. I am assuming the the tags needed are more easly understanded than $pdf-addCell($data,width..) Any ideias ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] managing cvs from php
Michal, The directories have a 777 (ok unsecure but just a test) setting. Any tips of how can I get the stderr or a better way to do this cvs interface ? On Thu, 19 Aug 2004 11:45:26 -0400 (EDT), Michal Migurski [EMAIL PROTECTED] wrote: $cmd = cd .$pathToFile. ; /usr/bin/cvs ci -m '.$logMsg.' .$file ; passthru($cmd) ; If I echo the $cmd and paste in a shell the command works. When I execute from web nothing happens and no output is seen (error_reporting(E_ALL)) Does the apache user have read/write privileges on the files in that directory? CVS makes heavy usage of stderr, so that may be a reason you are not seeing output. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] managing cvs from php
Hi, I use cvs from my internal projects and will soon need to let others change template files from a web form. The user will load the current template, edit, preview and if ok publish. Since I'd like to keep a history and track those changes one option for me would be to add a cvs call with a commit off the changed file. I do not need to do other fancy functions. Just commit and get the result if it worked. My current (not working) test script is simply $cmd = cd .$pathToFile. ; /usr/bin/cvs ci -m '.$logMsg.' .$file ; passthru($cmd) ; If I echo the $cmd and paste in a shell the command works. When I execute from web nothing happens and no output is seen (error_reporting(E_ALL)) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Web Mail
Yeah, but it is slow as hell. webmiau in the other way is fast On Mon, 5 Jul 2004 12:45:33 +0100, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Try www.horde.org It's not only a webmail client, but has a whole load more! Nunners Quoting I.A. Gray [EMAIL PROTECTED]: Thanks- looked at Squirrel Mail. Looks really good, however we use POP3- I don't think Squirrel Mail uses POP3 does it? -Original Message- From: Jose Leon [mailto:[EMAIL PROTECTED] Sent: 05 July 2004 12:09 To: I.A. Gray Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP Web Mail Hello, Does anyone know a good PHP-based (free if possible) web mail other than UebiMiau that they would recommend? Why not Squirrel Mail? http://www.squirrelmail.org Regards. -- qadram :: software development http://www.qadram.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending email without an email server
Hi jason, I've added the SMTP to a smtp server, saved the .ini and restarted the server with no luck. It complains Warning: mail(): sendmail_from not set in php.ini or custom From: header missing in c:\program files\apache group\apache\htdocs\email.php on line 131 Line 131 is the end of the file (?) The mail command is mail(Webmail .$emailTo.,[Contact],$msg,From: Webmail [EMAIL PROTECTED] \nReply-To: .$name. .$emailFrom.\n); Any tips ? On Tue, 13 Jul 2004 19:20:25 +0800, Jason Wong [EMAIL PROTECTED] wrote: On Tuesday 13 July 2004 18:46, robert mena wrote: I have a small script hosted in a win32/apache/php4 enviroment where I do not have a local email server. I was wondering how could I send emails either connecting directly to the mx or sending through a relay. mail() on Windows system does (only) use SMTP. Just configure your php.ini correctly and it should work. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHPEclipse?
I have downloaded the latest .zip from source forge but it keeps giving me an error has occured when activating this view.. and hsow the php browser. eclipse 3.0, linux fedora core2, java 1.4.2_04-fcs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sending email without an email server
Hi, I have a small script hosted in a win32/apache/php4 enviroment where I do not have a local email server. I was wondering how could I send emails either connecting directly to the mx or sending through a relay. regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] safe mode/open basedir not working ?
Ok. How about set the safe_mode_exec_dir to /dev/null then ? On Wed, 30 Jun 2004 21:55:17 -0700, Justin Patrin [EMAIL PROTECTED] wrote: YES. You need to set the safe_mode_exec_dir path to be some path without binaries. Such as: /etc, although that's a bad example. Make a directory with only root write access and point that config option to it. On Wed, 30 Jun 2004 22:31:27 -0400, robert mena [EMAIL PROTECTED] wrote: Marek, Justin, am I doing something wrong with the setup because I saw the logs and a redeye.php was used to system(perl -) and was not supposed to. On Thu, 01 Jul 2004 00:32:07 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote: Justin Patrin wrote --- napísal:: On Wed, 30 Jun 2004 23:50:02 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote: robert mena wrote --- napísal:: Hi, I host a few virtual domains in apache 2 and use php. The virtual domain is something like VirtualHost a.b.c.d:80 ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/httpd/html/domain.com ServerName www.domain.com ErrorLog logs/domain.com-error_log CustomLog logs/domain.com-access_log combined ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ Directory /home/httpd/html/domain.com/ AllowOverride AuthConfig Limit php_admin_value doc_root /home/httpd/html/domain.com/ php_admin_flag safe_mode on php_admin_value open_basedir /home/httpd/html/domain.com:/tmp/ /Directory /VirtualHost Recently I had a minor problem with a user that uploaded via ftp a php script in his domain and this domain used exec/system etc to call perl, read files. Shouldn't the settings above retrict such thing ? no, this setting affects only php, not programs executed from php If you have safe mode on, you can set various things to stop this. One is safe_mode_exec_dir. Actualy you have to if you want to use any of the exec functions: !DSPAM:40e37582309468563245817! -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] safe mode/open basedir not working ?
Ok. It did not worked. I had to create an empy dir. Well, one problem. Since I have users with ftp access and they host php scripts that handle file uploads. The files are created with apache.apache and are usually moved to the user's directory using move_uploaded_file. Since the owner/gorup of the script would be foo.ftponly this would fail due to uid differences. How do I solve this ? Change the user's group from ftponly to apache and use the safe_mode_gid on ? - rt On Fri, 2 Jul 2004 11:28:39 -0700, Justin Patrin [EMAIL PROTECTED] wrote: That *may* not work as it's a file, not a folder. You're welcome to try, though. :-) On Fri, 2 Jul 2004 14:19:25 -0400, robert mena [EMAIL PROTECTED] wrote: Ok. How about set the safe_mode_exec_dir to /dev/null then ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] safe mode/open basedir not working ?
Hi, I host a few virtual domains in apache 2 and use php. The virtual domain is something like VirtualHost a.b.c.d:80 ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/httpd/html/domain.com ServerName www.domain.com ErrorLog logs/domain.com-error_log CustomLog logs/domain.com-access_log combined ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ Directory /home/httpd/html/domain.com/ AllowOverride AuthConfig Limit php_admin_value doc_root /home/httpd/html/domain.com/ php_admin_flag safe_mode on php_admin_value open_basedir /home/httpd/html/domain.com:/tmp/ /Directory /VirtualHost Recently I had a minor problem with a user that uploaded via ftp a php script in his domain and this domain used exec/system etc to call perl, read files. Shouldn't the settings above retrict such thing ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] safe mode/open basedir not working ?
Marek, but the program was executed using a system call from a php script. - rt On Wed, 30 Jun 2004 23:50:02 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote: robert mena wrote --- napísal:: Hi, I host a few virtual domains in apache 2 and use php. The virtual domain is something like VirtualHost a.b.c.d:80 ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/httpd/html/domain.com ServerName www.domain.com ErrorLog logs/domain.com-error_log CustomLog logs/domain.com-access_log combined ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ Directory /home/httpd/html/domain.com/ AllowOverride AuthConfig Limit php_admin_value doc_root /home/httpd/html/domain.com/ php_admin_flag safe_mode on php_admin_value open_basedir /home/httpd/html/domain.com:/tmp/ /Directory /VirtualHost Recently I had a minor problem with a user that uploaded via ftp a php script in his domain and this domain used exec/system etc to call perl, read files. Shouldn't the settings above retrict such thing ? no, this setting affects only php, not programs executed from php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] safe mode/open basedir not working ?
Marek, Justin, am I doing something wrong with the setup because I saw the logs and a redeye.php was used to system(perl -) and was not supposed to. On Thu, 01 Jul 2004 00:32:07 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote: Justin Patrin wrote --- napísal:: On Wed, 30 Jun 2004 23:50:02 +0200, Marek Kilimajer [EMAIL PROTECTED] wrote: robert mena wrote --- napísal:: Hi, I host a few virtual domains in apache 2 and use php. The virtual domain is something like VirtualHost a.b.c.d:80 ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/httpd/html/domain.com ServerName www.domain.com ErrorLog logs/domain.com-error_log CustomLog logs/domain.com-access_log combined ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ Directory /home/httpd/html/domain.com/ AllowOverride AuthConfig Limit php_admin_value doc_root /home/httpd/html/domain.com/ php_admin_flag safe_mode on php_admin_value open_basedir /home/httpd/html/domain.com:/tmp/ /Directory /VirtualHost Recently I had a minor problem with a user that uploaded via ftp a php script in his domain and this domain used exec/system etc to call perl, read files. Shouldn't the settings above retrict such thing ? no, this setting affects only php, not programs executed from php If you have safe mode on, you can set various things to stop this. One is safe_mode_exec_dir. Actualy you have to if you want to use any of the exec functions: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHPOPENCHAT: he script tried to execute a method or access a property of an incomplete object.
Hi, I've installed and tested phpopenchat 3.0b2 in my development machine (Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6 PHP/4.3.0) with no problems. When I moved to the real server (PHP Version 4.3.2) it keeps giving me this answer Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition badodb_mysql/b of the object you are trying to operate on was loaded _before_ the session was started in /var/www/html/chat/include/class.Chat.inc on line 1130 I've used the test.php script that comes with no problem (it basically tests for user/password, existance of directories) Any ideias ? __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] comparing xml files, removing some html tags
Thanks to all (actually just one) that answered my question. Unfortunatelly I was hoping a more complete answer since the part I asked was not the main goal... bu t anyway... I'd like to ask then if the viewers could validate my new approach or at least point ways of actually implementing it. Suppose I use Xerces and tidy to turn two html files into two xhtml ones. I'd like to remove the data found between the Tags and generate two new files only with the scructure elements (tables, Br, p and so on). Then I could use regular diff from unix and if they differ in more than X% I assume they are different. Assuming that this approach is ok any tips regarding the actual implementation ? Any snippets of code would be great. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] comparing xml files, removing some html tags
Hi, I need to compare two XML files in order to find if they are similar, i.e their DOM tree have the same structure. The ideia is to use Xerces to balance HTML files in order to create Xhtml and then compare. To make things a little easier for Xerces I am considering to remove some elements that do not make diference for my similarity point of view, for example, script/script tags, before calling xerces. So I was wondering which regular expression should I use to remove the scriptcontent/script and so on... regards. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP / Oracle support (8/9) under Redhat 9
Hi Juan, But I'd need to compile php with oracle support. Do you have any experience with this setup ? RH9 + PHP with oracle support ? Regards. --- Juan Nin [EMAIL PROTECTED] wrote: From: Robert Mena [EMAIL PROTECTED] a) apache It seems that apache + php does not work well under heavy load so I should stick with 1.3.X right ? Any ideas where I can find a rpm package for redhat 9 ? Yes, stick with apache-1.3.x Latest 1.3.x version RPM from Red Hat for RH 7.3 is apache-1.3.27-2.i386.rpm I'm using the latest RH 7.1 apache RPM in a RH 9 and runs ok, which is apache-1.3.27-1.7.1 Latest PHP version for RH 7.1 is php-4.1.2-7.1.6 For RH 9 it's php-4.2.2-17, I guess there should be no problem in running that version with the apache-1.3.x from RH 7.x Regards, Juan __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP / Oracle support (8/9) under Redhat 9
Thanks for the reply. I already use 4.3.1 in my current server. I always compile my version of php since the ones that come with the distro are always too old and usually does not contain support for need features such as mcrpyt or oracle. - rt --- Justin French [EMAIL PROTECTED] wrote: I can't help with the Oracle question, but yes, stick with apache 1.3.x for the moment... It would also pay to look at what version of PHP you're currently running (eg 4.1) and see what major changes you're likely to experience when upgrading to the latest stable version. If your existing version is pre 4.1, the register globals will be an issue, for example. Sorry, I have no idea what version of PHP was on RH 7 __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with secure virtual host setup
Hi all, I host some virtual domains within my apache 1.3.x/php 4.3.x setup. Those domains are mantained by the users via ftp and I was wondering if I could secure the configuration a little bit more. I know that are limitations but the requirements would be : a) the user should not be able to access files outside the DocumentRoot besides system libraries or temporary files b) I'd like to have a system wide repository where common libraries, classes should be accessed without having to copy and mantain individually c) Since the user has some php thet perform a file upload, those scripts must be able to move, rename, delete files located under the document root As a starting point the user has a ftp login and the document root is owned by the login.apache so the user and the apache can access and alter the contents. Best regards. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP / Oracle support (8/9) under Redhat 9
Hi, I am planning to migrate my current web server from redhat 7.x to 9 and I am currently evaluating what may go wrong or need special attention before I actually replace it. After searching the archives and other lists I still have a couple of questions : a) apache It seems that apache + php does not work well under heavy load so I should stick with 1.3.X right ? Any ideas where I can find a rpm package for redhat 9 ? b) oracle support For the current setup I've downloaded and installed the oracle 8i (8.1.5) in a separate machine, tar.gz the lib directory in order to compile and run php with oracle 8i. Is this the best approach for Redhat 9 or should I try to install oracle 9 which hopefully may have a devel-only option ? Note that php needs to access external oracle 8 servers which I do not mantain. Regards. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.0/4.3.2 - Strange problem with exec / move_uploaded_file
Hi, I am faciing a strange problem. I have some php script to receive images (via file upload). The script is failling to work because it can't move/copy the file. I've added a sleep(x) in order to make the temporary file stick around. 20 -rw---1 apache apache 19402 Jul 4 10:49 /tmp/phpFj6Irk I've added apache to an upload group upload:x:1098:apache And changed the owner of the directory. ls -sla /home/httpd/html/foo.com/img/news/ total 24 4 drwxrwxr-x6 webmaste upload 4096 Jul 4 10:11 . 4 drwxrwxr-x5 webmaste webmaste 4096 Jun 10 15:55 .. 4 drwxrwxr-x2 webmaste upload 4096 Jun 4 09:41 1 4 drwxrwxr-x2 webmaste upload 4096 Jul 4 10:48 10 4 drwxrwxr-x2 webmaste upload 4096 Jul 4 09:54 2 And the both commands below fail. move_uploaded_file($tmpfile,$destination) exec(/bin/cp $tmpfile $destination,$array) The var_dump in array shows array(0) { } The $destination var has (checked with echo) /home/httpd/html/foo.com/img/news/10/xxx.jpg Any ideias ? __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Oracle support under PHP / 8i or 9 and a RedHat 9 / Apache 1.3.X machine
Hi, I have a server (currently 7.1) with apache + php compiled with oracle (mcrypt, imap, gettext) support. In order to do so I've installed the 8i linux versions, make a tar.gz of the libs directory and installed in my server. I runs fine accessing a remote (not mantained by me) oracle database. I am planning to switch to a newer distribution and was considering the RH9 but with the old apache. Since I do not actually use Oracle (just enable php scripts to do so) I am kind of lost if the combo (old 8i libs with redhat 9) are stable enough or should I try a newer version, such as oracle 9. And in that case if PHP level of support is the same (oracle 8 or 9). Since the answer can be slighty OT fell free to send me directly. Thanks. __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to solve include_path / safe_mode / open_basedir /document_root ?
Hi, I host some virtual servers in a Linux/apache/php 4 enviroment. I'd like to set up as secure as possible since the users have ftp access to upload files. So each virtual domain has a safe_mode/open_basedir settings in order to make it difficult to mess with each other's files. Unfortunatelly this seems to have a side effect. Whenever I need to provide tools/classes such as Jpgraph, Smarty and so on I have to copy to the user's directory since the include_path could not reach outside the document root/open_basedir directory. So, is there a way to configure so I have a secure enviroment and yet be able to define a common repository. Regards. __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Correct number format (curency)
Hi, I have one application where the users enter a curency value. Unfortunately even tough I write the correct format I keep receiving all kinds. Example 1.000,00 1000.00 1,000.00 I would like to convert those to a single format 1000.00 Is there any function in php that already does that ? Or perhaps any code snippets ? thanks. __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sax-like : accessing form fields elements
Hi, I am developing an application which will have to parse a html page and extract information about the forms found. I tried the HTMLSAX class (http://www.phpclasses.org/browse.html/package/678.html) which is ok except by the fact that I can not retrieve the default/checked status from the elements. Ie. select name=foooption value=bar ckecked Any ideias ? Since the html will usually be ill-formed a standard DOM-tree (with builtin functions at least) wont be possible. __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with 4.3.0 cli and paths
Hi, I have upgraded my server with the 4.3.0 version. The cli was upgraded also and all my scripts started to crash. I ususally put a #!/husr/local/bin/php -q in all scripts that need to be executed from the crontab. All the sudden the scripts ended with error messages such as Warning: main(../php/define.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /home/httpd/html/script.php on line 11 What's going on ? Do I need to put the full path now ? regards. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] another problem with 4.3.0 : imagecreatefromjpeg undefined
Hello again, another problem with 4.3.0. I have gd support but after the upgrade my scripts started complaing : Fatal error: Call to undefined function: imagecreatefromjpeg() My ./configure (the same used for ages). './configure' '--with-apxs' '--with-ttf' '--with-xml' '--with-gd' '--with-ftp' '--enable-session' '--enable-trans-sid' '--with-zlib' '--enable-inline-optimization' '--with-mcrypt' '--enable-sigchild' '--with-config-file-path=/etc' '--with-freetype' __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange behaviour with 4.3.0 : warning of an unspecified open_basedir
Hi, I've upgraded the php version from 4.2.2 to 4.3.0 yesterday and some of my users started complaining about errors in php scripts. The errors do not occur all the times and the messages shown are weird (for me at least) ! The user is accessing a php file located under /var/www/html/site.com/private/alt.php3. It performs a mysql query. I have a virtual host in apache so /var/www/html/site.com/ is mapped as www.site.com. The error messages : Warning: Unknown(): open_basedir restriction in effect. File(/var/www/html/site.com/private/alt.php3) is not within the allowed path(s): (/home/httpd/html/anothersite.com/) in Unknown on line 0 Warning: Unknown(/var/www/html/site.com/private/alt.php3): failed to create stream: Operation not permitted in Unknown on line 0 Warning: Unknown(): Failed opening '/var/www/html/site.com/private/alt.php3' for inclusion (include_path='.:/usr/local/lib/php/:/home/httpd/html/php/:/home/httpd/html/include/php/') in Unknown on line 0 The strange part is that the safe_mode is off and it mentions a directory from another virtual host (anothersite.com). VirtualHost IP ServerAdmin webmaster DocumentRoot /home/httpd/html/site.com/ ServerName www.site.com.br ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ Directory /home/httpd/html/site.com/ #php_admin_value doc_root /home/httpd/html/site.com/ php_admin_flag safe_mode off #php_admin_value open_basedir /home/httpd/html/site.com/:/tmp/ /Directory /VirtualHost System : Linux / Redhat 7.3 / Apache 1.3 './configure' '--with-gd' '--with-apxs' '--with-xml' '--with-ftp' '--enable-session' '--enable-trans-sid' '--with-zlib' '--enable-inline-optimization' '--with-mcrypt=/usr/local' '--with-imap=../imap-2001a ' '--with-kerberos' '--with-oci8=/u01/app/oracle/product/8.1.7/' '--enable-sigchild' '--with-gettext' '--with-freetype' '--with-ttf' '--with-ftp' '--enable-ftp' __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems to compile php (cvs)
Hi, I usually fetch php from cvs a couple of times in order to try new features etc. Unfortunately since the beginning of this week I have been unable to compile, no matter what I do. I have been cvsing daily, buildconf and the same ./configure settings I have been using for ages. ./configure --with-apxs2 --enable-gd-native-ttf --with-xml --with-openssl --with-zlib --with-dom --with-gd --with-ttf The error : home/php4/ext/standard/basic_functions.c: In function `php_simple_ini_parser_cb': /home/php4/ext/standard/basic_functions.c:2827: `ZEND_INI_PARSER_POP_ENTRY' undeclared (first use in this function) /home/php4/ext/standard/basic_functions.c:2827: (Each undeclared identifier is reported only once /home/php4/ext/standard/basic_functions.c:2827: for each function it appears in.) Any tips ? __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Win32 php : MS Access support (odbc support)
Hi, I will have to retrieve data stored in a MDB (MS Access) database. Since this MDB file be hosted in a Windows machine I'd like to have a CGI version of PHP with ODBC support so I can retrieve the data locally and send to a remote mysql database automatically. Since I've never used the CGI version to MDB any tips/caveats will be appreciated. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Advice with encrypting+storing sensitive data
Thanks Bahwi, I agree with you regarding the client-side aspect. But since we are talking about a regular web-based application in php I think I will have to deal with that. The other security concerns are already addressed, such as the use of SLL to encrypt the traffic and possibly the use of an encoder do hide the source code. I do not think I understood your ideia : The next best thing is to store it in session variables, but build your own system perhaps, and yes, encrypt it lightly with some system and a system passphrase __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Advice with encrypting+storing sensitive data
Hi, I need to develop an application where the protection of the data (to be stored on a database) should be very important (perhaps the principal requirement). THe goal is to have the data stored in a way that even the admin or anyone that hacks the web and/or database server could not (or easily) recover the original data. First of all I am not a security expert and the protection need not to be military-grade, just strong enough to make things harder. I would like to share a couple of ideias but mostly interestered in phpers experiences and opinions. 1) Use mcrypt The user should have to create a phrase and all sensitive data will be stored using this phrase. Since the phrase will not be hardcoded in the php scripts, even if the web is hacked it will not be recovered. For each row I would store the encrypted value and the initialization vector. In order to recover the value at the beginning of the session (when the user logs in) I could store the phrase as session variable (encrypted with mcrypt and a system phrase?) If the user decides to change the phrase a big update in all encrypted rows/fields would be necessary. 2) Use PGP Basically the same ideia but differnt encryption tool/scheme. Not sure how to implement or if there is any gain. Well any tips/sugestions/opinions are welcome. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] rad tools, form paser/validator
Hi all, I've been working with php for a while and whenever I have the chance I give some tutorials/speeches about it to other developers, specially those with no experience with web development. They all find easy but in one point or another start asking about an IDE with a debugger, variable watch etc or RAD tools (they come from Visual Basic/Delphi enviroments). In the IDE part I know we have some paid tools (such as Zend) but can't tell anything that could count as RAD tool. So, I'd like to know if there are any RAD tools , either free or paid that you know. One thing that I am planing to develop, or enhance if I found something similar already, is a form parser/validator. Suppose your design department comes with a real nice html-css-form and you need to validate it, send the content as email or add in a database. This tool would read the HTML and prompt you for the optional/required fields, validation options (minimum/max length) etc, send via email or add in a database.. Then would generate the php code to validate and perform the required actions. I think there is a classe (from manuel lemos) that does soemthing similar but also generate the form itself based on a definition. What do you thing about it ? The ideia is to speed up the repetitive/boring stuff leting the developer focus on special logic - usually restricted to fewer options. __ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Redhat 8.0 / php-cvs - /usr/lib/httpd/build/instdso.sh: No such file or directory
Hi, I've reinstalled my devel machine with RedHat 8.0. After a cvs update of php I've decided to recompile and install since the mod-php (which I did not install) from RedHat is a little outdated :) I've removed the config.cache, make clean and make. The compilation was ok, but while trying to make install Installing PHP SAPI module /usr/lib/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib/httpd/build/libtool' libphp4.la /usr/lib/httpd/modules sh: line 1: /usr/lib/httpd/build/instdso.sh: No such file or directory apxs:Error: Command failed with rc=8323072 Any tips. I've searched the archives with no luck. __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] building a crawler with PHP
Hi, I'd like to know if anyone has good references (links, ps, pdf etc) about building a crawler and tips regarding doing that with PHP. This would be mostly for learning purposes. thanks. __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Oracle NLS : Access from PHP
Hi, I have some script to access an Oracle database using stored procedures. When I access a development database everything runs fine. When I access the production database I get errors PLS-00553: character set name is not recognized ORA-06550. The problem seems to be related to NLS. So in the beginning of the script I've put : putenv(ORACLE_BASE=/u01/app/oracle) ; putenv(ORACLE_HOME=/u01/app/oracle/product/8.1.7); putenv(ORA_NLS33=/u01/app/oracle/product/8.1.7/ocommon/nls/admin/data/) ; putenv(ORACLE_SID=MYSID) ; putenv(NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1) ; But the error continues. The remote database has the following parametes (select * from nls_database_parameters) 'NLS_LANGUAGE','AMERICAN' 'NLS_TERRITORY','AMERICA' 'NLS_CURRENCY','$' 'NLS_ISO_CURRENCY','AMERICA' 'NLS_NUMERIC_CHARACTERS','.,' 'NLS_CHARACTERSET','WE8ISO8859P1' 'NLS_CALENDAR','GREGORIAN' 'NLS_DATE_FORMAT','DD-MON-RR' 'NLS_DATE_LANGUAGE','AMERICAN' 'NLS_SORT','BINARY' 'NLS_TIME_FORMAT','HH.MI.SSXFF AM' 'NLS_TIMESTAMP_FORMAT','DD-MON-RR HH.MI.SSXFF AM' 'NLS_TIME_TZ_FORMAT','HH.MI.SSXFF AM TZH:TZM' 'NLS_TIMESTAMP_TZ_FORMAT','DD-MON-RR HH.MI.SSXFF AM TZH:TZM' 'NLS_DUAL_CURRENCY','$' 'NLS_COMP','BINARY' 'NLS_NCHAR_CHARACTERSET','WE8ISO8859P1' 'NLS_RDBMS_VERSION','8.1.7.0.1' My development database has the following settings : SQL select * from nls_database_parameters; PARAMETER VALUE -- NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CHARACTERSET US7ASCII NLS_CALENDAR GREGORIAN NLS_DATE_FORMATDD-MON-RR NLS_DATE_LANGUAGE AMERICAN NLS_SORT BINARY NLS_TIME_FORMATHH.MI.SSXFF AM NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZH:TZM NLS_TIMESTAMP_TZ_FORMATDD-MON-RR HH.MI.SSXFF AM TZH:TZM NLS_DUAL_CURRENCY $ NLS_COMP BINARY NLS_NCHAR_CHARACTERSET US7ASCII NLS_RDBMS_VERSION 8.1.7.0.1 Help! :) Rt. __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange behaviour : php accessing Oracle (PLS-00553: character set name)
Hi, Ie developed some scripts to access oracle. Using my development machine it works great. When I switch to the production server I keep getting Warning: OCIStmtExecute: ORA-06550: line 3, column 33: PLS-00553: character set name is not recognized ORA-06550: line 0, column 0: PL/SQL: Compilation unit analysis terminated in /var/www/html/test.php on line 35 This only happens with stored procedures. Regular selects work fine. Since the same production server is used by many delphi applications I may be doing something wrong. Any tips will be appreciated. If this is considered off-topic please email me directly. Regards, __ Do You Yahoo!? Got something to say? Say it better with Yahoo! Video Mail http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: strtok bug
Hi Manuel and all developers. I understand that the implementation of strtok was broken (non POSIX compliant) but since it has been like this for ages would be better to give a chance to developers worldwide (that has been using and relied on this broken implementation) to control the behaviour of such feature much the same way REGISTER_GLOBALS (or something) in recently 4.1.0. Imagine recoding 100+ distributed scripts to change this! The decision of having this fixed is great but not paying attention (like you always did in the past) with backwards compatibility is (IMHO) a mistake. Best regards, Robert --- Manuel Lemos [EMAIL PROTECTED] wrote: Hello, Robert Mena wrote: Hi, does anybody know when the strtok bug introduced After 4.0.6 . in 4.1.1 will be fixed ? Will we have a 4.1.2 or should I try to grab a cvs tree (assuming that it is already solved) ? You may want to ask that in php-dev mailing list because last time that I reported it I was told that it would not be fixed because it was just me complaining. __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] strtok bug
Hi, does anybody know when the strtok bug introduced in 4.1.1 will be fixed ? Will we have a 4.1.2 or should I try to grab a cvs tree (assuming that it is already solved) ? thanks. __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] output compression and imp 2.x not working under IE
Hi, I've recently upgraded my server to php 4.1.1 and turned on the output compression under php.ini. For some browsers (IE 5/5.5 so far) it made imp stop working. Does anybody know if this is a limitation of php, imp or explorer ? Anyone has tried that with the latest imp/horde ? thanks. __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] problems with php 4.1.1 (strtok?)
Hi, I have a script to upload/insert records in a mysql db. I was running fine before the upgrade (php 4.0.4pl1) now it confuses the columns starting with the column number 9. I've attached a one line file that I used with the scripts. the problem seems to be with strok and null values. One of the columns is empty so I have value1\t\tvalue2 and it seems to confuse itself. The script that parses the line is like this $C_F=strtok($line,\t); $dt=strtok(\t); $DT=strtok(\t); Using the same script under php4.0.6 with the same upload file it shows (correct) : insert into table values values('05','01/11/01','10:01','MYCOMPANY','04.679.080/0001-04','OTHERCOMPANY','SP-SAO PAULO','47.427.653/0014-30','109726','02','091330','15','VOL','PROD','383,1000','10075/01','EQT-0001','EQT-0001','','','','','','','','','01/11/01','08:00','01/11/01','18:00','09/11/01','08:00','09/11/01','08:00','','7D,22H','') Using the same script under php4.1.1 with the same upload file it shows (incorrect 02 at column number 9) : insert into cargas values values('05','01/11/01','10:01','MYCOMPANY','04.679.080/0001-04','OTHERCOMPANY','SP-SAO PAULO','47.427.653/0014-30','02','091330','15','VOL','PROD','383,1000','10075/01','EQT-0001','EQT-0001','01/11/01','08:00','01/11/01','18:00','09/11/01','08:00','09/11/01','08:00','7D,22H','050210972604.679.080/0001-0447.427.653/0014-30091330','/ /','','','','','','','','','109726') Thanks. __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com 05 2001110101/11/0110:01 MYCOMPANY 04.679.080/0001-04 OTHERCOMPANYSP-SAO PAULO47.427.653/0014-30 109726 02 091330 15 VOL PROD383,100010075/01EQT-0001 EQT-0001 01/11/0108:00 01/11/0118:00 09/11/0108:00 09/11/01 08:00 7D,22H 050210972604.679.080/0001-0447.427.653/0014-30091330/ / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Support for GIF, PNG and JPEG. How ?
Hi, I was wondering if there is a wayto compile php with gd support for the gif, png and jpg file types. As far as I know gd dropped gif support while ago when it added png. regards, __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] oracle 8i stored procedures + php access
Hi, I have a delphi application that uses oracle as db server with stored procedures (running ok). I've been trying to make a php version of such application with no luck so far. I've created a user to access such thing and I keep getting the following error Warning: OCIStmtExecute: ORA-06550: line 3, column 3: PLS-00905: object SYSTEM.CAD013_PSQ_RSV is invalid ORA-06550: line 3, column 3: PL/SQL: Statement ignored in /somewhere/test.php on line 20 Warning: OCIFetchInto: ORA-24338: statement handle not executed in /somewhere/test.php on line 31 If I try with user system the messages are diferent Warning: OCIStmtExecute: ORA-06550: line 3, column 3: PLS-00905: object SYSTEM.CAD013_PSQ_RSV is invalid ORA-06550: line 3, column 3: PL/SQL: Statement ignored in /somewhere/test.php on line 20 Warning: OCIFetchInto: ORA-24338: statement handle not executed in /somewhere/test.php on line 31 The script follows putenv(ORACLE_BASE=/u01/app/oracle) ; putenv(ORACLE_HOME=/u01/app/oracle/product/8.1.7); putenv(ORACLE_SID=oracle) ; $usernameOracle=dbuser; $passwordOracle=dbpassword; $hostOracle=dbhost; $tsA = time() ; $con = OCIPLogon($usernameOracle,$passwordOracle,$hostOracle); $tsD = time() ; $res = OCINewCursor($con); $stm = OCIParse ( $con, BEGIN CAD013_PSQ_RSV(:pkey, :Option, :RES); END; ); $name = foo; $option = 0; OCIBindByName ( $stm, :pkey, $nome, -1); OCIBindByName ( $stm, :Option, $option, -1); OCIBindByName ( $stm, :RES, amp;$res, -1, OCI_B_CURSOR ); @OCIExecute ( $stm ); OCIExecute ($res); $arrError = OCIError($res); if ($arrError['code']) { echo $arrError['code'].-.$arrError['message'].lt;brgt;; exit; } while (OCIFetchInto($res,amp;$data)) var_dump($data); } OCIFreeCursor($stm); OCIFreeStatement($res); The stored procedure has one code bellow IF (vmINT_QtdLines lt;= 0) THEN -- PHP raise_application_error( -20005, 'NAME NOT FOUND' ); -- DELPHI -- DBMS_OUTPUT.PUT_LINE('NOTHING FOUND:'||pkey); -- RAISE Erro; END IF; I am not quite sure where the problem is located. Any help (if directly related to oracle emails directly) wl be appreciated. Thanks. __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] oracle 8i stored procedures + php access
Hi, I have a delphi application that uses oracle as db server with stored procedures (running ok). I've been trying to make a php version of such application with no luck so far. I've created a user to access such thing and I keep getting the following error Warning: OCIStmtExecute: ORA-06550: line 3, column 3: PLS-00905: object SYSTEM.CAD013_PSQ_RSV is invalid ORA-06550: line 3, column 3: PL/SQL: Statement ignored in /somewhere/test.php on line 20 Warning: OCIFetchInto: ORA-24338: statement handle not executed in /somewhere/test.php on line 31 If I try with user system the messages are diferent Warning: OCIStmtExecute: ORA-06550: line 3, column 3: PLS-00905: object SYSTEM.CAD013_PSQ_RSV is invalid ORA-06550: line 3, column 3: PL/SQL: Statement ignored in /somewhere/test.php on line 20 Warning: OCIFetchInto: ORA-24338: statement handle not executed in /somewhere/test.php on line 31 The script follows putenv(ORACLE_BASE=/u01/app/oracle) ; putenv(ORACLE_HOME=/u01/app/oracle/product/8.1.7); putenv(ORACLE_SID=oracle) ; $usernameOracle=dbuser; $passwordOracle=dbpassword; $hostOracle=dbhost; $tsA = time() ; $con = OCIPLogon($usernameOracle,$passwordOracle,$hostOracle); $tsD = time() ; $res = OCINewCursor($con); $stm = OCIParse ( $con, BEGIN CAD013_PSQ_RSV(:pkey, :Option, :RES); END; ); $name = foo; $option = 0; OCIBindByName ( $stm, :pkey, $nome, -1); OCIBindByName ( $stm, :Option, $option, -1); OCIBindByName ( $stm, :RES, $res, -1, OCI_B_CURSOR ); @OCIExecute ( $stm ); OCIExecute ($res); $arrError = OCIError($res); if ($arrError['code']) { echo $arrError['code'].-.$arrError['message'].br; exit; } while (OCIFetchInto($res,$data)) var_dump($data); } OCIFreeCursor($stm); OCIFreeStatement($res); The stored procedure has one code bellow IF (vmINT_QtdLines = 0) THEN -- PHP raise_application_error( -20005, 'NAME NOT FOUND' ); -- DELPHI -- DBMS_OUTPUT.PUT_LINE('NOTHING FOUND:'||pkey); -- RAISE Erro; END IF; I am not quite sure where the problem is located. Any help (if directly related to oracle emails directly) wl be appreciated. Thanks. __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] SAFE_MODE + deleting files
Hi, I have enabled the safe mode in a virtual host that uses php in order to try to prevent the user from uploading (via ftp) a php that could sniff around other's people files. Unfortunately I got stucked in a problem. this site uses php to upload and manage some files remotely. The webserver runs as nobody.nobody but the files are owned by the user's id. Warning: SAFE MODE Restriction in effect. The script whose uid is 1515 is not allowed to access /home/httpd/html/some_site/img/foo.jpg owned by uid 99 in .php on line 43 Any tips ? Best regards. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Permutation in PHP
Hi I am looking for an algorithm to generate the permutation of the elements of a vector, say a,b,c. Does anybody know / have implemented such (in PHP or different languages). Best regards. __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mcrypt segfault (still)
Hi, a couple of weeks ago I posted a problem with mcrypt under php with at least 4.0.5,4.0.6 and 4.0.7-dev. The server works ok until you use a mcrypt function (it segfaults). The bug has been reported in bugs.php.net and assigned. Unfortunately so far no solution or news regarding this. Does anybody have a working php 4.0.5+ and mcrypt installation ? Perhaps it is something with the latest libmcrypt. Best regards. __ Do You Yahoo!? Get email alerts NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Segmentation fault (11) : mcrypt
Hi, I've trying to use mcrypt and php (4.06 or 4.07-dev) with no luck. Everytime I use I got a [notice] child pid 16630 exit signal Segmentation fault (11) in my apache's error.log. I am using the latest libmcrypt-2.4.15 and php (a hour ago cvs update). Is this a known bug ? './configure' '--with-apxs' '--with-ttf' '--with-xml' '--with-gd' '--with-ftp' '--enable-session' '--enable-trans-sid' '--with-zlib' '--enable-inline-optimization' '--with-pgsql' '--with-openssl' '--with-imap=../imap' '--with-gettext' '--with-mcrypt=/usr/local' ?php $cipher=MCRYPT_TripleDES ; $mode=MCRYPT_MODE_ECB ; $td = mcrypt_module_open ($cipher, , $mode, ); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND); mcrypt_generic_init ($td, $key, $iv); $encrypted_data = mcrypt_generic ($td, $valor); mcrypt_generic_end ($td); ? __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Converting from paradox DB to mysql
Hi, Does anybody knows how can I convert from a Paradox DB to mysql ? I've searched freshmeat.net but pxtools gives me core dump and unixODBC seems to be just the driver (i.e I'd have to write a convertion tool). Thanks. __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP/Apache security question : bugtraq, suExec etc
Hi, I follow bugtraq and recently there was a thread regarding safe_mode of php and how to break it. The thread was killed without a conclusion to where this is really a new threat or the same problem (scripts executed with sage uid/gid of the web server). So, I was wondering if the php-dev team has already reached a veredict. I recently saw a post about the use of suExec and I'd like to know the performance impact and is there anything php could do to make such thing easier (perhaps this is more an apache issue). Up to now all my virtual domains have used safe_mode, openbase_dir and document_root settings limiting the access to files/scripts located under the virtual directory and no access to override the settings with a .htaccess. Is this secure enough ? My major concern is the hability to upload a php code (using ftp), some c files of a local exploit, compile it and execute as apache... thanks. __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] enable_dl : manual not clear enough?
Extension Loading Directives Hi, While reading the english version of the manual I got stucked in a part that seems a little confusing. enable_dl boolean This directive is really only The main reason for turning dynamic loading off is security. With dynamic loading, it's possible to ignore all the safe_mode and open_basedir restrictions. The default is to allow dynamic loading, except when using safe-mode. In safe-mode, it's always imposible to use dl(). Well it is or isn't possible to use dl with safe_mode ? It says ...With dynamic loading, it's possible to ignore all the safe_mode and open_basedir restrictions. and then In safe-mode, it's always imposible to use dl().. __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] To be or not to be : safe mode
Hi, I've decided to turn on/set safe_mode, document_root and open_basedir in apache's httpd.conf in order to make the scripts a little more secure (some upload files such as image) in a virtual host. Everything worked fine except for a couple of scripts. Those scripts (used for file upload) first move (with move_uploaded_file from /tmp to a folder/directory located under the document root of the site. The user verifies that he really wants that image and then (another script) moves to the definitive folder/directory. Since the 2 part was not working I've changed to use the copy function and it gave me a ..SAFE MODE Restriction in effect. The script whose uid is X is not allowed to access /home/httpd/html/somewhere/imgtmp/uploaded_img.png owned by uid Y (the web server) in /home/httpd/html/somewhere/script.php3 on line 34 How do I solve this ? For now I've disabled safe_mode. But I am considering setting it back on and change (somehow) the default upload dir to a new one. Since move_uploaded_file still works (even with safe_mode) I assume I will work but another problem arises. The name of the uploded file (which I do not control) is something like phpUKXh6R so how to tell the browser of the correct mime-type ? I do have the original name... Changing the uid of the scripts to the same of the web server seems to bring aditional security problems. Thanks. __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]