PHP Jquery Wall Post - php

I'm trying to build a post-to-wall system. I followed a tutorial and it looks like I'm fairly close. However, loads of warnings come up when I post instead of the actual post. Do I need to setup a database somwewhere? I've never done much with PHP or databases, so excuse my ignorance.
http://beulahprint.ie/facebook_wallpost_system/

This all depends on whether you have underlying access to the machine that you are doing your development on.
If it is a linux machine and you are able to log into it then the following command will work for Red Hat (and it's derivatives: fedora, centos, etc...) as well as deban based systems such as ubuntu:
mysql --version
If this command reports some form of error they you will probably need to install mysql with one of the following commands:
sudo yum install mysql-server
OR
sudo apt-get install mysql-server php5-mysql
The sudo part makes you superuser so that you may install the software (not everyone) can install software you know. When you have run this command the computer will go through all the normal steps to install the software, but it will ask you a number of questions like: what would you like the root password to be? what IP is mysql going to run on? Luckily MySql fills most of these in by default.
If you are running on windows then it is just a matter of downloading the installation file from the mysql website, double clicking the .exe, and following the installation steps.
Good luck!
EXTRA: If you are looking for an easy way to access your mysql database you can't go far wrong with 'MySQL GUI Tools', just google it.

All of the errors you are seeing are due to a missing database and the inclusion of db files. You'll need to connect to the database (using PDO or MySQLi) and update it with the content you are entering. Looks like you are about halfway there.

Related

Yum Update PHP Conflict

I am very new to linux and am trying to do an update to my AWS linux web server to update the PHP. I type in sudo yum update and it comes back with an error saying, “php73 php common conflicts with php-common-5.4.16-48.el7.x86_64”. How would I go about solving this kind of issue?
I tried searching around the internet to see if there was any forums or videos but nothing that I saw related to this.

Installing MySQL extension in Godaddy Servers.

I am not a Pro at server side scripting so here goes one small problem I am having and hopefully someone out there will be able to point me in the right direction.
I am transferring a site to a new shared hosting in Godaddy. In the process installatron didn't migrate correctly so I had to pick up where it left off and manually did the rest. After checking the PHP info I noticed that the MySQL Extension is not installed.
I did some research online and came up with this code to create an installation of the extension. My only problem is that I do not know where to add this code.
# apt-get install php5-mysqlnd
Do I add it to my php.ini file? do I input this through my cmd prompt? or Do I add it to my htaccess file?
I thought the CMD was the proper way to go but I don't mess around with CMD too often so I am slowly getting better at it.
Is this the proper way to go?
Do I use the same credentials to log in via CMD as FTP, cPanel or ???
Thank you for your constructive inputs.

Textmate now requires my password?

I'm following Kevin Skoglund's "Php using MySQL" tutorials on lynda.com. In the installation he uses sudo a lot to configure stuff and open files. All of this is on the terminal for Macintosh computers. He starts the apache server using sudo apachectl start or restart. He also opens many pages with the nano text editor(which is used in the terminal) and he uses sudo before the majority of the commands. The pages he goes into are things like php.ini.
Before I started his course, I installed php and MySQL in a different way, that caused some problems with the 'socket'(I'm not too familiar with what a socket is). So that's why I had to go to the installation chapter to install everything the sudo way(I'm aware that sudo is more dangerous than smoking at a petrol station).
So now when I go to textmate, it constantly requires my user password to save files and the files in my project drawer glow red. Also, even if I do type my password, it makes the sound that means "YOU CAN NOT DO THIS!". Could you please tell me how to make everything stop requiring passwords? PLEASE HELP! Thanks.
Edit: Ok, when I use ls -la in my php folder, the files come up with "rw-r--r--". Anyone know how to change the permissions?

PHP and the build process (/.configure, make and install): orientation, please

I'm a newbie and after I've successfully learnt enough to build my simple but useful web services, I managed to put myself in a position where I need to configure my own PHP build.
The problem is I don't really know what build means --never built anything either.
My broad question is:
Any good step by step tutorial that doesn't just say "must have dependencies"?
My specific question is:
For instance, one that shows how to build PHP with odbc, then rebuild (configure.nice and make nice?) with imap in addition.
If someone finds a PHP bundle that comes with odbc, great; with odbc & imap, better. But I'm really looking for someone to show me how to fish. Please.
Thnx.
A.
Gazler is correct, for a simple setup, you can just configure Ubuntu through the repositories via apt-get. For RHEL-based systems - yum would be the equivalent. However, if you are wanting to know more of how to compile from scratch (which would give you more control over installation), then you can do so.
Basics of compiling an application:
Download source from website (such as PHP, www.php.net)
untar the source (tar -xzvf source.tar.gz)
cd source
Configure the source (./configure [install-option-flags])
Compile source (make)
Test Install (doesn't actually install) - make test
Install the software (make install)
Step 4 is a very broad step. You will need to figure out what options you want to configure - see PHP Core Configuration Options.
Requirements for installing PHP will differ between environments, so that's too broad to cover in one answer, however, you will at least need a c-compiler to compile the source. Usually gcc is my choice, and is usually installed already. On Ubuntu (Debian-based) use apt-get install build-essential or search and install via yum on RHEL-based systems, I believe it would be something like yum install gcc.
You will probably run into dependencies issues as you compile, as I said its a very broad step, however, once you figure out the requirements that you need, you should be good to go, so long as you document your steps for your environment.
Again, the easiest way to go is to install via your software repository (apt-get, yum, emerge, pacman, etc), but these don't give you as much leverage on controlling your environment installation, whereas building from source gives you all the configuration control that you'd need.
You haven't mentioned what distro you are on, On ubuntu you can do:
sudo apt-get install lamp-server^ php5-imap php5-odbc
That should be enough to get you started and configured.

Best PHP download to keep all my options open?

In the past, I used WAMPserver on windows to parse PHP for me. This is a pre-configured package, focussed on working with MySQL.
When I tried to run PostgreSQL, I got error messages that said that my version of PHP wasn't compiled to work with PostgreSQL.
So, I've recently uninstalled WAMP and every associated with it. I've downloaded Apache 2.2.11 with openSSL, installed as admin(you know, run the command prompt as administrator, cd to the directory where the download was done and have it executed, so the install was done as admin).
That's that. I now have Apache installed, "it works" shows up, so I'm that far.
Now I'm wondering, do I download the exe and install, or the zip, or something else.
What is the best thing to do to make sure that the PHP on my system can handle everything I can ever throw at it?
Also, PHP first, or MySQL/Postgre first.
And lastly, what about PEAR? I need PEAR installed, which isn't standard on Windows. I'm guessing the pear.bat file in the PHP downloads will do that for me?
EDIT: I see one close vote, yet no comment as to why. It makes me wonder how people who are so lazy and rude got to have somany points.
I would recommend downloading the zip package, as configuring php is not really that difficult, and it allows you to add features as needed.
As for whether first to install php or MySQL/PostgreSQL, - it does not really matter. You can install them in any order.
Your guess regarding PEAR is quite correct
i haven't used wamp before, so i can't comment on that
i do however use xampp which sounds very similar
in xampp if i want to enable postgres support i edit the php.ini file and uncomment the postgres section of the ini file, same with any of the extensions that i need
perhaps this might be an alternative you can try if you get stuck
There are many ways to setup a HTTP server/PHP/database machine. Sometimes the behaviour of your development setup will differ from the live server's.
I would recommend finding out the setup your web host is using, then getting a vmware appliance image that fits that as close as possible and get any additional software using it's package manager (which is easier that installing stuff on Windows).
Setup a file sharing link between the VM and the host, make sure you can view the VM's port 80 in a browser running in your host OS and you're set.

Categories