Jump to content

jay3ld

Members
  • Posts

    11
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

jay3ld's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. http://php.net/Enchant This seems interesting to me. But for the life of me, I can't figure out what I am doing wrong. I have ispell installed and I can run it via command line to have it suggest words. But I can't get it to work through PHP. I have compiled 5.3 from source with enchant enabled. I can use the enchant functions. But the issue is that enchant doesn't seem to be able to find the dictionaries. I tried a test script I found on php.net, modified it to output more details. This is what it gave me: Could the myspell provider be screwing things up? I have tried to compile enchant without myspell and then recompiled php. But no luck still. Any one else play with Enchant yet? Any ideas here? I know I could easily build pspell into PHP, but I wanted to play with this. As it seems this is being removed in 5.3. So I want to get a handle on how this works for my few applications that are using spell checking.
  2. ok , so you are listing files from inside an FTP session? PHP has almost any kind of libraries you need to make life easy for you. check out the FTP module. you can use ftp_nlist() function to list files from remote server, then get the results and manipulate them as you wish. Correct, but it doesn't provide you with any other information that is useful such as permissions, ownership, modified time, etc. That is why I am doing it this way. This script isn't something I intend to release. It is being used on remote servers I have. The script has to be via FTP, as apache on that server doesn't run with enough permissions to the files/folders to to chmod.
  3. nrg_alpha, No the string itself isn't in question. The output should always be similar to that. ghostdog74, The reason why I can't use those is that this information comes from a FTP connection (via a socket). I didn't see any information in FTP functions on getting the file permissions. Daniel0, Would those work with a remote socket connection to a FTP server? I have done a fsockopen to a FTP server, been able to authenticate, list files, change their permissions, etc. But I haven't found an easy way to just obtain the information I want (Their permissions)
  4. Hello, I am creating a regular expression to match the output from the command "ls -go". I only really want the permissions and the file name. I came up with this that works: ~([-d][-r][-w][-x][-r][-w][-x][-r][-w][-x])+\s+\d+\s+\d+\s+\d+\s+\d+\s+[A-Za-z]+\s+\d+\s+[\d:\d]+\s([A-Za-z0-9_\-]+.[A-Za-z]{3})+~mis I optimized it down to this: ~([-drwx]{10})+[\s\d]+[A-Za-z]+[\s\d:]+([A-Za-z0-9_\-.]+.[A-Za-z]{3})+~mis Any ideas on how i can optimize it any more than this? Did I miss something that my testing didn't see that could cause this to miss a true result?
  5. Thank you, While it wasn't exactly what I wanted. After some tweaking I got it working exactly how I needed it to.
  6. The problem is the php code with the array. Is basically plain text and not parsable without causing issues.. I am wanting to pull out its information though.
  7. I have this file I can't parse because there would be lots of errors and undefined errors. So I am using regex to pull out the array information I have a basic array like this lets say: $my_array = array( 'key' => "value", 'another_key' => 'another_value' ); So far I have accomplished finding the first part of the array with: preg_match_all("~\\\$([a-zA-Z0-9]+) = array\(([\s]+)('([a-zA-Z0-9]+)' => \"(.+?)\"(,))+[\s]+~", $contents, $matches); The problem is I can't figure out how to get the second item from the array, or a possible third, or possible fourth, etc. I thought adding () around it and giving it a + would do this. But it doesn't seem to do this. Anyone know what I did wrong here?
  8. I have modified PHP 4.4.7, 5.2.3, and 6.0 to all have different handlers so I could run them at the same time as modules in my apache (2.0.59) To even get all 3 to work I had to compile php4 without mysql as it seems to have errors with something about mysql and something defined to much. I receive this error in my error log while trying to use php4. [error] [client 127.0.0.1] Negotiation: discovered file(s) matching request: /Users/me/Sites/index (None could be negotiated). [error] [client 127.0.0.1] Premature end of script headers: php First one was easy. I added /index.php to my url and it stops happening (I will figure it out later I guess). The second one has me stumped. This usually means CGI error. But I set them up as cgi. I even ran the file from command line and it outputs ok with no 500 error. These are the parts in my httpd.conf that really mater that might help # The part that loads the modules. LoadModule php4_module /sw/lib/apache2/modules/libphp4.so LoadModule php6_module /sw/lib/apache2/modules/libphp6.so LoadModule php5_module /sw/lib/apache2/modules/libphp5.so # The part that does the virtual hosts. <VirtualHost *:8080> ScriptAlias /php6/ "/sw/usr/local/php6/" Action php6-script /php6/bin/php AddHandler php6-script .php </VirtualHost> <VirtualHost *:8081> ScriptAlias /php5/ "/sw/usr/local/php523/" Action php5-script /php5/bin/php AddHandler php5-script .php </VirtualHost> <VirtualHost *:8082> ScriptAlias /php4/ "/sw/usr/local/php447/" Action php4-script /php4/bin/php AddHandler php4-script .php </VirtualHost> Any suggestions? PHP6 and PHP5 work just fine.
  9. hmm.. I messed around with those and nothing helped.. still not working..
  10. Hello, I am trying to figure out how to insert/create folders into a zip created by php and enter files into that folder. I never used php zip functions or anything like that So I am running off what I read around. Basicly if you want to know what I am trying to do is after my website gets backups of each of my databases in mysql and put them into a folder I want to zip the folder up and then mail it.. I can get the backups and mail files but its the zip part I am trying to figure out how to do. The reason I am trying to do this is my mysql databases are getting so big its starting to get hard to open one big text file when I need to get something that I lost back into my mysql database. So doing multiple Files for each of my databases (and optional for each table in database when I need to know that) should help me out with opening files.. This is what I wrote as a test.. In the folder there are 3 files like this database1.sql database2.sql database3.sql [code] <?php $path = '/home/user/testlocal/public_html/Mysql-backups/backups'; //Open the Direcotry were the files are saved. $dir_handle = opendir($path) or die("Unable to open $path"); //Read the Direcotry. while ($file = readdir($dir_handle)) { //Ignore any files starting with . or index     if(substr($file, 0, 1) == '.' || substr($file, 0, 5) == 'index')         continue; //Get the Extension out of the name and test it.. if(substr($file, -3, 3) == 'sql') $files[$i++] = $file; else         continue; } //Open the file $gz = gzopen('DatabaseBackups.gz','w9'); //Instert Into the zip file. Repeating process for each. for ($a = 0, $i => $a, $a++) gzwrite($gz, $files[$i]); //Close it up. gzclose($gz); ?>[/code]
  11. Hello, For the first time today I installed apache 2.2.3 and php 5.1.4 on my computer manually without installers and going to do mysql soon. Took me almost 3 hours to get php one done correctly because of a lib (libxml2) I didn't have on my computer. I am getting a 500 error on a page that uses .htaccess The .htaccess has stuff from mod_rewrite.. I know there is nothing wrong with the .htaccess It works on my webserver and It came with the websoftwre I downloaded. I configured apache with this when I installed it: ./configure \ --prefix=/apache2 \ --enable-module=most \ --enable-shared=max Did I miss anything I should of had in the install line that could of affected me? 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.