I’m a little familar with html, but I’m trying to teach myself php as well. The books and online tutorials aren’t helping when I can’t simply say a hello world…
A simple echo doesn’t work…
What is wrong with my code? It didn’t work when I was in Vista opening with firefox. Maybe it’s the firefox browser?
I tried
<?php echo “hello” // with and without a semi-colon here.]
?>
and I literally tried every simple logical thing possible, yet it still didn’t want to print out “hello”
I then copied and pasted a code that was supposedly correct and showed what it should print out on the website, and I copied, pasted, and viewed in browser and it failed!..
Is it because I have to install some php thing before writing in it?
If that is so, then why do php forums on the internet work anyway?
–
Overall I wanna learn php, and the first steps in the books don’t work, lol.
You can also execute PHP directly from the command line if you have the
CLI pieces installed in the OS and you either call the script with the PHP
executable or have the script using a ‘shebang’ line at the top like with
other scripts that points to the PHP interpreter:
#!/path/to/php5
<?php
echo ‘test’;
?>
Good luck.
antiparadigm wrote:
> You need to have a web server installed and the php functionality
> installed & enabled.
>
> In openSUSE it is really easy. just install apache2 & php5, then fire
> up the server via yast run levels. Then place the files in
> /srv/www/htdocs
>
> Here is a quick tutorial: ‘Apache Quickstart HOWTO - openSUSE’
> (http://en.opensuse.org/Apache_Quickstart_HOWTO)
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
XAMPP is NOT recommended for openSUSE as we package all required software.
Do not install or use it. People keep messing up with the distribution
packages and config.
If you want LAMP, do:
zypper in -t pattern lamp_server &&
a2enmod php5 &&
/etc/init.d/mysql start &&
/etc/init.d/apache2 start &&
chkconfig -a apache mysql
Better? And as far as I know it can’t do any permanent harm as it all stays in the xampp directory instead of the the mentioned ‘messing with the configuration’. Then again it’s been a while since I used it.
Although openSUSE does make life easy, setting up mysql and using PHPMyAdmin is still a ton easier with xampp. However I wouldn’t use it for anything but testing things locally.
linux-5lan:~ # rcapache2 start
Starting httpd2 (prefork) done
linux-5lan:~ # yast2 –install php5 php5-mysql apache2-mod_php5
No such client module –install
The search path follows. It does not include the current directory.
/y2update/clients
/root/.yast2/clients
/usr/share/YaST2/clients
Swimi wrote:
> This is what happens when I try to install php…
>
>
> I’m still trying to figure this out.
>
>
>
> linux-5lan:~ # rcapache2 start
> Starting httpd2 (prefork)
> done
> linux-5lan:~ # yast2 –install php5 php5-mysql apache2-mod_php5
> No such client module –install
> The search path follows. It does not include the current directory.
> /y2update/clients
> /root/.yast2/clients
> /usr/share/YaST2/clients
>
> Run ‘yast2 -h’ for help on usage
> linux-5lan:~ #
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org