Open AppSer installed folder in that find conf folder and find httpd.conf file. In that file find below line(LoadModule rewrite_module modules/mod_rewrite.so)
For Example In Windows: D:\AppServ\Apache2.2\conf\
"LoadModule rewrite_module modules/mod_rewrite.so" if hash is there before the line remove that hash("#") and save the file and restart the AppServer to work
Wednesday, October 27, 2010
Sunday, October 24, 2010
Enable curl in php localhost Apache
Open your php.ini file and found the line 'extension=php_curl.dll' and remove the semicolon (; Here semicolon is comment). After that save the file and restart the apache server. You have done.
It is also helpful in future. Find the line 'extension=php_mcrypt.dll' and remove the semicolon before it if there. Save the file and restart the apache server.
It is also helpful in future. Find the line 'extension=php_mcrypt.dll' and remove the semicolon before it if there. Save the file and restart the apache server.
increase execution time in php
We can increase it in different ways based on server
Method 1: It will work in most servers. Add this function in top of page.
ini_set('max_execution_time', 600); //600 seconds
Method 2: We can set it by using .htaccess. Adding the below line in .htaccess file. It will work almost all servers.
max_execution_time 600
Method 3: If it is localhost. Open php.ini file and this word ('max_execution_time') where you can see like this by default max_execution_time = 30. You can change that 30 to your required based on your execution time for example (600) after that you have to restart the apache server.
Method 1: It will work in most servers. Add this function in top of page.
ini_set('max_execution_time', 600); //600 seconds
Method 2: We can set it by using .htaccess. Adding the below line in .htaccess file. It will work almost all servers.
max_execution_time 600
Method 3: If it is localhost. Open php.ini file and this word ('max_execution_time') where you can see like this by default max_execution_time = 30. You can change that 30 to your required based on your execution time for example (600) after that you have to restart the apache server.
Create csv file in php
$data = "Id, FirstName, LastName, Email, Phone, ZipCode"."\n";
$data .= "1,'Test1','Test2','Test@gmail.com','546435','10001'"."\n";
$myFile = "userinfo.csv";
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh, $data);
fclose($fh);
$data .= "1,'Test1','Test2','Test@gmail.com','546435','10001'"."\n";
$myFile = "userinfo.csv";
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh, $data);
fclose($fh);
Saturday, October 9, 2010
difference between curl and file_get_contents
file_get_contents - It is a function to get the contents of a file(simply view source items i.e out put html file contents).
curl - It is a library to do more operations, for example get the contents like file_get_contents, sending and receiving data from one site to another site and it also supports different types of protocols like http, https, ftp, gopher, telnet, dict, file, and ldap. curl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading HTTP form based upload, proxies, cookies.
You can read more about these in http://php.net/
curl - It is a library to do more operations, for example get the contents like file_get_contents, sending and receiving data from one site to another site and it also supports different types of protocols like http, https, ftp, gopher, telnet, dict, file, and ldap. curl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading HTTP form based upload, proxies, cookies.
You can read more about these in http://php.net/
Subscribe to:
Posts (Atom)