Jump to content

everbright

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

everbright's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, I'm trying to create a simple PHP script for backing up my SVN repositories via svnadmin.exe. My environment is as follows:- OS: Windows 7 PHP version: 5.2.12 SVN (VisualSVN): 1.6.6 Here's my PHP code sample: system("\"D:/VisualSVN/bin/svnadmin.exe\" dump \"E:/VisualSVN/Repositories/MyProject\" > \"E:/PHP/Batch Scripts/ServerBackup/Backups/20110311/svn/MyProject.svn\"", $code); print "Code: $code"; The result of this script is that the error code is 1, which means the command isn't dumping out the data as expected. However if I run the command manually through a command console, the data comes out fine, and I get MyProject.svn generated as expected. I'm executing the PHP script using a command window that's running as Administrator, so I don't think it's a permission issue. Any ideas what status code 1 is for svnadmin.exe? Also does anyone know how to get this working? Thanks in advance for any suggestions!
  2. Hi guys, Just wondering if anyone has any ideas how to do the following: D:/Programs/PHP/A.php function getPath() { ??? } D:/Programs/PHP/Sub/B.php include_once '../A.php'; print getPath(); What I want is for getPath to return the path of B.php (i.e. D:/Programs/PHP/Sub) when I run B.php. Anyone has any ideas how to do this? I've tried to use dirname(__FILE__), but that just returns the path of A.php, i.e. D:/Programs/PHP. Thanks in advance for any suggestions!
  3. Hi all, I've upgraded my PHP from v5.2.3 to v5.2.10, and encountered something strange, which hopefully some of you have encountered before and found a fix. Here's the details. Environment Windows Server 2003 Enterprise Edition Apache 2.2.11 PHP 5.2.3 -> 5.2.10 What I did to upgrade 1. Get the zipped binary version of PHP v5.2.10 for Windows from php.net. 2. Unzip the file in 1) to D:\PHP\5.2.10 3. Copy the php.ini file from my existing v.5.2.3 installation (located in D:\PHP\5.2) to the unzipped installation in 2). 4. Back-up the 5.2.3 installation. 5. Renamed D:\PHP\5.2.10 to D:\PHP\5.2 6. Restart Apache (which is using the PHP installation in D:\PHP\5.2) What's strange 1. Apache started up correctly without any errors. 2. I could also run PHP scripts hosted by the Apache server. 3. However when I tried to run phpinfo(), the script tells me that I'm still using v5.2.3! 4. I ran "php -version" on a cmd window in D:\PHP\5.2 and confirmed that the PHP installation there is indeed v5.2.10. 5. Also checked that the version of D:\PHP\5.2\php5apache2_2.dll is v5.2.10 6. Re-booting didn't help either. 7. Deleting the v5.2.3 installation completely didn't help either. 8. I've also checked for any installations elsewhere, and there are no other installations of PHP elsewhere. Does anyone have any ideas what else I might be missing here? I've previously upgraded PHP from v5.1.4 to v5.2.3 and did not encounter this. So seems strange that this would happen with this upgrade. Appreciate any help with this. Thanks!
  4. Thanks Ken2k7 for the advice! I think I'll try that. Probably a good solution
  5. Hi all, I'm using PHP v5.2.9. Am having some problem with variable scoping here, as follows: I have a file config.php as follows. Basically this defines a list of configuration parameters to be used by a class. config.php $config1 = 'Test1'; $config2 = 'Test2'; Then I have another file class.php in the same folder, which includes config.php and tries to use the configuration parameter as follows: class.php require_once 'config.php'; class TestClass { function testConfig() { global $config1, $config2; print "Config 1 = $config1, Config 2 = $config2"; } } When I tried to create the class and run testConfig, the 2 config variables are empty, i.e. could not get the values from config.php. One solution will be to pull the configuration parameters inline to class.php, but I want to avoid that, as the configurations will be used elsewhere and I want to avoid duplication of code. Has anyone encountered such a problem also? Any suggestions on what I can do to work around this?
  6. Hi all, I'm currently involved in customizing the Open Source CMS Joomla for usage in a secure environment. One of the security requirements is the need to be able to make it as hard as possible for the server administrators to be able to compromise the database. Unfortunately, Joomla (and I guess almost all PHP application) puts its database connection parameters in clear in its configuration file. OS file permissions will not help as the SAs will be able to compromise that easily. Has anyone had experience with such scenario, and any good implementations that you can share over here? Thanks!
  7. Thanks for the tip! That did it  :D [quote author=fractil link=topic=97157.msg389297#msg389297 date=1151595237] In the "Error handling and logging" section of your php.ini file you can change a couple of settings to meet your needs. First make sure that the error reporting setting is set to the following: error_reporting  =  E_ALL If you want errors to echo to your browser page you should change the following setting to on: display_errors = On If you want to log errors to a file turn off the display_errors setting and set the path of the error log: error_log = "C:\php\error_log.txt" Cheers! [/quote]
  8. Hi all, I'm using PHP 5.1.4 and am now trying to connect to an Oracle database using ADODB library. Here's the sample code I used to test out: [code]include("./adodb/adodb-exceptions.inc.php"); include("./adodb/adodb.inc.php"); $DB = NewADOConnection('oci8');   $DB->PConnect("lportal", "lportaldbuser", "lportalpw"); try {            $DB->Execute("select * from wiki_user"); } catch (exception $e) {         print_r($e); } print "Hi";[/code] I tried using Oracle SQL Plus to connect with the same credentials and it works there. Here's what I got when I ran the script: [code]Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS' in E:\Miscellaneous\MediaWiki\adodb\adodb.inc.php on line 3930[/code] Note that it didn't print "Hi", meaning that for some reason, it stopped execution somewhere before that and refused to spit out any more helpful error messages :-( By commenting out and gradually uncommenting the lines, I found that the error happens with the line: [code]$DB->PConnect("lportal", "lportaldbuser", "lportalpw");[/code] Any ideas what I might have missed out here? How can I get more info on this error? Maybe some configuration with ADODB? Thanks in advance for any suggestions!
  9. Hi all, I'm totally new to PHP, and am starting to learn the ropes here, after years of frustration with ASP's limitations. I've successfully set up PHP 5.1.4 with IIS 6.0 (I'm using Windows 2003 Server OS). Ran into some strange behaviour when I started to do some simple codes. Whenever there's a mistake in my code, and I hit the script, IE or FireFox just gives me a blank screen, instead of spitting out error messages that help. That left me troubleshooting in the blind [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] Anyone knows how I can turn on debugging messages for PHP on IIS and Apache? Thanks!
×
×
  • Create New...

Important Information

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