Hello there i am trying to test and see if my php5 works but i cannot seem to create a file to see if php works aka
<?
phpinfo();
?>
or however you type it but i do vi /srv/www/htdocs/file.php to create the file and it opens up great but it doesn’t let me type anything in there lol i right clicked it and set the input method to none then i can type but i cant save i tried :w and XX but it tells me it cannot make changes to the file in bright red ? am i doing something wrong? also i need to install phpmyadmin so i am trying to save the install file to /srv/www/htdocs and then extract it in there aka
mv phpMyAdmin-3.3.4-all-languages phpmyadmin
cp config.sample.inc.php config.inc.php
or what not but i don’t have permission to the directory i am not using my laptop as my hosting device lol thats why i pay for dedi hosting i just want to install lamp to my computer with port 80 blocked etc… just to mess around with php coding so is there any way just to raise permissions to /srv so i can just create files in there since it is in the user group root? lol i know this might seem dumb but i really really dont want to turn my machine into windows xp permission’s basically lol i am so close to going to /etc/sysconfig displaymanager and changing my DISPLAYMANAGER_ROOT_LOGIN_REMOTE=“no” to say yes LOL i know this sounds dumb but i am only using this laptop for 1 thing only just to code php i don’t play games on this i don’t browse the web nothing just trying to set up lamp to experiment with php so can someone please help me?
To get meaningful assistance tell us whic openSuSE version and desktop environment (if any) you have installed.
Software (e.g. phpMyAdmin) is best installed via YaST >> Software >> Software Management.
Install the pattern Web and LAMP Server.
Read a basic book such as “Webmaster in a Nutshell”.
If you want to set up a web server, create a folder and change its ownership to the webmaster’s username (your own?).
you@localhost:~> su -
Password:
localhost:~ # mkdir /serv/www/vhosts.d
localhost:~ # chown you /serv/www/vhosts.d
localhost:~ # exit
you@localhost:~>
and create *DocumentRoot * for each of your websites within /serv/www/vhosts.d.
Users on Unix and Linux systems generally have their own personal web-sites with the DocumentRoot in ~/public_html or somesuch.
If you just want to practice then place your scripts in ~/public_html and view the results in a browser via http://localhost/~you/.
i greatly appreciate the help guys i am running opensuse 12.1 gnome environment eng-int i really appreciate your help i mean thank you this solved all of my problems and as for webmaster in a nutshell i am googling that as we speak thanks for the suggestion. and hcvv i am currently reading php5 fast and easy web development they have not told me it isnt valid instead they are teaching me to use that tag and <script language=“php”> </script> tag may i ask you if you think i should pick up a different book? lol i don’t want to learn things that are not valid lol but thank you for your input i really do appreciate it also should i be turning on apache 2 a different way then sudo /etc/init.d/apache2 start? lol just curious
Strange book you have. The short form <? ?> is not supported by default in recent PHP versions. The normal form <?php ?> is, as is the official long form <script …></script> which I have never seen used in practice. Sorry I don’t have any recommendations for a better book.
You don’t have to keep starting and restarting Apache. Use YaST to make it start at boot and leave it running. In particular you don’t have to restart Apache if you have just edited a script. The only times you have to restart Apache with PHP is if you have modified php.ini or have installed another PHP module.
it is okay ken_yap that you don’t have any recommendations for a better book i greatly appreciate your input and thanks i am looking in yast to make my apaache start at boot and you mean say like i add or modify a module in my php5.ini i should restart apache for example to make it take effect?
And of course in openSUSE YaST is the prefered systemm management tool. Thus YaST > System > System Services (runlevel) will give you the easiest interface to make Apache a service running on your system from boot until shutdown.