Archive for the ‘php’ Category

php-pear

I have just installed PEAR on my 64-bit Debian (PHP5) server:
# aptitude install php-pear

Then I installed HTTP_Download package by typing:

# pear install –alldeps HTTP_Download
# pear install –alldeps DB

  • Comments Off

jquery flash Upload error 500

This is what i got from the server log:

mod_security: Access denied with code 500. Error processing request body: Multipart: final boundary missing [severity "EMERGENCY"]

This error message from ModSecurity means that the request body was not
properly constructed or something was wrong with the file upload (most
likely that the client timed out and did not fully complete the upload).

Other possible reasons for this -

1) If the end of the final boundary is missing a CRLF
2) If the size specified in the Content-Length header is too small. In
this case, Apache would cut off the end of the file.

Known bugs
If you are using Apache with mod_security this will not work, you need to put the following in your .htaccess file to disable mod_security:

SecFilterEngine Off
SecFilterScanPOST Off

Disabling mod_security isn’t allowed on some shared hosts, and only do this if you know what you are doing.

So editing the .htacces is what i will do next

  • Comments Off

phpagi text2wav install

install
festival festlex-cmu festlex-poslex festvox-kallpc16k libestools1.2 sgml-base

config /etc/asterisk/phpagi.conf

[phpagi]
debug=false???????????????????????????? ; enable debuging
error_handler=true????????????????????? ; use internal error handler
admin=manon@101g.com??????????? ; mail errors to
hostname=203.149.62.46????????? ; host name of this server
tempdir=/var/spool/asterisk/tmp/??????? ; temporary directory for storing temporary output

[asmanager]
server=localhost??????????????????????? ; server to connect to
port=5038?????????????????????????????? ; default manager port
username=admin????????? ; username for login
secret=pass???????????? ; password for login

[fastagi]
setuid=true???????????????????????????? ; drop privileges to owner of script
basedir=/usr/sharc/asterisk/agi-bin/??? ; path to script folder

[festival]????????????????????????????? ; text to speech engine
text2wave=/usr/bin/text2wave??????????? ; path to text2wave binary

[cepstral]????????????????????????????? ; alternate text to speech engine
swift=/opt/swift/bin/swift????????????? ; path to switft binary
voice=David???????????????????????????? ; default voice

!!working

  • Comments Off

cron php

install php5-cli

15 * * * * /usr/bin/php -q /var/www/sms/cron.php

  • Comments Off

Drupal? เมื่อเราติดตั้งนั้นจะมีขั้นตอนหนึ่งที่กล่าวถึง Clean URL
Clean URL ก็คือการใช้ URL แบบไม่มีเครื่องหมาย ?

http://www.myintranet.org/drupal/?q=admin/settings/clean-urls

เมื่อใช้ Clean URL ก็จะเป็น

http://www.myintranet.org/drupal/admin/settings/clean-urls

ถ้าเรายังไม่ได้แก้คอนฟิก ของ Apache เราก็ไม่สามารถใช้ Clean URL ได้ ดังภาพ

แก้คอนฟิกของ Apache? ดังนี้

1. ใช้คำสั่ง? sudo a2enmod rewrite

2. แก้ไฟล์ /etc/apache2/sites-available/default
โดยเพิ่ม

<Directory /var/www/drupal>
AllowOverride all
RewriteEngine on
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.+\..+)$ [NC]
RewriteCond %{HTTP_HOST} !^.+\..+\..+$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule ^files/(.*)$ sites/%1/files/$1 [L]
RewriteRule ^files/(.*)$ sites/%1/files/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
</Directory>

Document? Root อยู่ที่ไหนก็ระบุให้ถูกนะครับ ในที่นีคือ? /var/www/drupal
3. แก้เสร็จก็ restart? service? ของ apache /etc/init.d/apache2 restart

ที่มาและรายละเอียดมากกว่านี้ http://drupal.org/node/134439

กรณีที่เราเช่าโฮสติ้งและเราไม่สามารถแก้คอนฟิกเองได้ ก็สามารถแก้ไขไฟล์ .htaccess ได้
ตามลิงค์นี้นะครับ http://drupal.org/node/121834

ตัวอย่าง .htaccess ที่ใช้อยู่ที่ ireallyhost

  • Comments Off

originate call with asterisk+php


<?
$strHost="127.0.0.1";
$strUser="admin";
$strSecret="****";
$strChannel="Local/".$_GET["to"]."@from-provider";
$strWaitTime="10";
$strCallerId=$_GET["from"];
$strReceiver=$_GET["from"];
$strContext="from-provider";

  $oSocket = @fsockopen($strHost, 5038, $errnum, $errdesc)
or die("Connection to host failed");
        fputs($oSocket, "Action: login\r\n");
        fputs($oSocket, "Events: off\r\n");
        fputs($oSocket, "Username: $strUser\r\n");
        fputs($oSocket, "Secret: $strSecret\r\n\r\n");
        fputs($oSocket, "Action: originate\r\n");
        fputs($oSocket, "Channel: $strChannel\r\n");
        fputs($oSocket, "WaitTime: $strWaitTime\r\n");
        fputs($oSocket, "CallerID: $strCallerId\r\n");
        fputs($oSocket, "Exten: $strReceiver\r\n");
        fputs($oSocket, "Context: $strContext\r\n");
        fputs($oSocket, "Priority: 1\r\n\r\n");
        fputs($oSocket, "Action: Logoff\r\n\r\n");
  while (!feof($oSocket)) {
    $wrets .= fread($oSocket, 8192);
  }
 fclose($oSocket);
  if (stripos($wrets, 'Originate successfully queued')) {
    echo "Call completed ";
  } else {
    echo "No accept call ";
  }
?>
  • Comments Off

Time

Mp3

Msn status

  • manon2029@hotmail.com is

Chat with Meeh

Donate

    If you find an article useful, then please make a donation.

หมวดหมู่

UserOnline

Counter

  • Visitors today: 36
  • Visitors yesterday: 83
  • Visitors per day: 317
  • Max. visitors per day: 255
  • Total page views: 166,311
  • Page views of this page: 317
  • Currently online: 1
  • Max. online: 36
  • Total visitors: 35,955
  • counterStatistics