Featured
-
Under Construction13 Feb 2011
This site is under construction......
More Features
Latest News
-
How to get list of pages using fbl multi query?
09 Dec 2011facebook application fbi multiquery list page id
-
Easiest and Quickest way / tutorial to learn cronjob in ubuntu
09 Dec 2011cronjob, ubuntu, easiest, tutorial
-
How to enable curl in ubuntu?
07 Nov 2011To enable curl package php5-curl should be installed. Run the following command in your terminal sudo apt-get install php5-curl Now restart apache by running following code sudo /etc/init.d/apache2 ...
-
Easiest way to install LAMP On Ubuntu
29 Oct 2011For a beginner its really a difficult to install LAMP on Ubuntu. Even if it is installed its very difficult to run phpmyadmin properly. I am ...
-
How to solve “Access forbidden! You don’t have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster. Error 403 localhost Mon 24 Oct 2011 07:45:12 PM NPT Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0c PHP/5.3.5 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1″ problem?
24 Oct 2011Some times while we wish to run any project on xamp or wamp or lampp we might this error message as: Access forbidden! You don't have permission ...
More News
- How to solve “Error MySQL said: Documentation #2002 – The server is not responding (or the local MySQL server’s socket is not correctly configured) Connection for controluser as defined in your configuration failed.” problem?
- How to install Django in windows?
- How to solve “Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required ‘/opt/lampp/htdocs/……/index.php’ (include_path=’.:/opt/lampp/lib/php’) in Unknown on line 0 ” problem?
- How to solve indexOf javascript problem in internet Explorer?
- How to fetch / extract data using CURL in PHP?
Hello friends, i wanted to get the list of facebook pages that logged in user created using graph api. But i have to research a lot and didn't get code online. So i have placed this tutorial to get list of pages that a user is admin of. Hope it will help. Please don't forget to place comment if it helps. Thanks.
$query1 = 'select page_id from page_admin where uid =' .$userid;
$query2 = 'select page_id, name, page_url from page where page_id in (select page_id from #query1)';
$queries = '{ "query1": "' . $query1 . '",
"query2": "' . $query2 . '"}';
$result = $facebook->api(array(
'method' => 'fql.multiquery',
'queries' => $queries ,
'access_token' => $access_token));
var_dump($result);
?>
Cron is a system daemon used to execute desired tasks (in the background) at designated times. I am demonstrating most simple form of cronjob in ubuntu.
- Open terminal and enter the following command:crontab -e
- Enter following line of code: 34 09 * * * env DISPLAY=:0 gedit
- Save this settings
Description: Here 34 represents minute, 09 represents hour and *,* and * are for every day, month and weekdays and * represents always. This will open text editor on 9 am and 34 minutes everyday, every month and every weekdays. Change 34 and 09 to your nearest upcomming time. For eg if your current time is 10:20 AM then change 34 to 24. So that you can see result within few minutes. So your modified command will look like this 24 10 * * * env DISPLAY=:0 gedit. Command env DISPLAY=:0 is for displaying gui programs like gedit. You can replace gedit with skype or any programs you like. crontab -e command is for editing the existing cron jobs. To check your existing cron job hit crontab -l in the terminal.
To enable curl package php5-curl should be installed. Run the following command in your terminal
sudo apt-get install php5-curl
Now restart apache by running following code
sudo /etc/init.d/apache2 restart
Hope this solution will help to enable curl in your ubuntu system.
For a beginner its really a difficult to install LAMP on Ubuntu. Even if it is installed its very difficult to run phpmyadmin properly.
I am going to share my personal experience and difficulties we may encounter during installation.
First of all we are going to install apache, php, mysql and phpmyadmin
A) Installing Apache
B) Installing Php
C) Installing Mysql
D) Installing Phpmyadmin
A) Installing Apache
1. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
2. The Terminal might ask you for your password, type your password and then press enter.
3. Testing: Run http://localhost/ url in your browser. If you get a message "It works!" then Apache is sucessfully installed.
B) Installing Php
1. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
2. The Terminal might ask you for your password, type your password and then press enter.
3. Restart apache by runing this code to make Php compatible with Apache.
4. Testing PHP
i. In the terminal copy/paste the following line:
ii. Copy and Paste following line code into the testingphp file:
iii. Save the file.
iv. Run http://localhost/testingphp.php in your browser. If it displays 'Hello World!!!' then PHP is alswo sucessfully installed.
C) Installing Mysql
1. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
2. If you need to give access to the server you have created for others computer in your network you must edit the my.cnf file.
Modify the line
to
Change 127.0.0.1 to your IP address (eg 192.168.0.1)
(Note you can skip this step)
3. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
If you get Following error message
COMMAND:mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');
ERROR:mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');"
then run
4. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
Add the following line of code inside apache2.conf file:
and restart Apache:
5. Now copy and paste this line in your terminal:
Note: You can change password of your choice. But if you wish to work without your password then you should modify /etc/phpmyadmin/config.inc.php file
i. Run the following code in your terminal
2. Change
line to
D. Installing Phpmyadmin
1. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
2. Edit php.ini file by running following code in your terminal
Change
to
If you dont find ;extension=mysql.so then skip it uncomment other mysql lines eg.
3. Run following code in your terminal to restart apache
4. Testing: Run http://localhost/phpmyadmin in your browser if you get window of phpmyadmin then you might be asked with username and password.
Username: root
Password: (If you had set password from step C.5. then enter that password or leave it empty)
If you get login then congrats. Now you have got installed all Apache, PHP, Mysql and Phpmyadmin.
Some times while we wish to run any project on xamp or wamp or lampp we might this error message as:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Mon 24 Oct 2011 07:45:12 PM NPT
Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0c PHP/5.3.5 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
This is due to the permission problem. By default we don't have permission to access files so we need to change its permission. I have installed my xampp on /opt/lampp/ folder and my project folder name is testproject. To avoid this error i have granted permission as:
sudo chmod -R 0777 /opt/lampp/htdocs/testproject
After running this code on terminal. It works fine.
- How to fetch / extract data using CURL in PHP? 11 comments
- How to solve "Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/opt/lampp/htdocs/....../index.php' (include_path='.:/opt/lampp/lib/php') in Unknown on line 0 " problem? 9 comments
- How to solve "Error MySQL said: Documentation #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured) Connection for controluser as defined in your configuration failed." problem? 5 comments
- How to solve "Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster. Error 403 localhost Mon 24 Oct 2011 07:45:12 PM NPT Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0c PHP/5.3.5 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1" problem? 2 comments
- How to solve indexOf javascript problem in internet Explorer? 1 comments
- Gjon: Thank You!!...
- gringo: If the permission change does ...
- Marco: It works!!! :D...
- admin: @nirav: welcome brother......
- nirav ( india): hi i m nirav from india a soft...
- admin: @geetanjali: Did u solved it n...
- Derian: Thank's buddy, it's really hel...
- geetanjali: no,i am still getting the prob...
- princess: It is not working.... I am sti...
- Alexandre: Good job man! You solved my pr...