Re: [PHP] tutorial failure
On Thu, 2010-08-26 at 17:45 +0100, e-letter wrote: > On 20/08/2010, Ashley Sheridan wrote: > > You don't have to reinstall the entire OS, that's a very Windows > > approach to the problem. I played around a bit last night with urpmi and > > you should be able to just list the packages you need with urpmq --fuzzy > > package_name, and then install the ones listed you think you need. I did > > notice that urpmi doesn't install the DB when you install the Apache mod > > for that DB, so you might need to install that separately, but other > > than that, you should be good to go if you install the Apache php mod. > > > > > True with respect to the windoze mentality but I had other reasons to > reformat the pc so this was a good opportunity. > > The resultant web page is: > > Hi, I am a PHP script > > this is a test > > However, the manual page implies to me that the web page should have > shown the html code, i.e. > > > > php test > > > Hi, I am a PHP script > this is a test > > > > The source code of the web page: > > > > php test > > > Hi, I am a PHP script > this is a test > > > > > Is this an error with the explanation of the manual or is the > apache-php configuration still at fault? > The manual page says that the output is the HTML code, which is exactly what you're getting. Your browser is responsible for interpreting those tags, based on the mime header that it receives from PHP (which is text/html by default) You should only ever need to change this header when you are outputting some other type of content, like XML, an image, etc. If you change your PHP script and add this line before you output any content you will see the tags as your browser will interpret them as plain text (Internet Explorer may screw this up, as it tends to ignore header mime types more often than not): header("Content-type: text/plain"); Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] tutorial failure
On 20/08/2010, Ashley Sheridan wrote: > You don't have to reinstall the entire OS, that's a very Windows > approach to the problem. I played around a bit last night with urpmi and > you should be able to just list the packages you need with urpmq --fuzzy > package_name, and then install the ones listed you think you need. I did > notice that urpmi doesn't install the DB when you install the Apache mod > for that DB, so you might need to install that separately, but other > than that, you should be good to go if you install the Apache php mod. > > True with respect to the windoze mentality but I had other reasons to reformat the pc so this was a good opportunity. The resultant web page is: Hi, I am a PHP script this is a test However, the manual page implies to me that the web page should have shown the html code, i.e. php test Hi, I am a PHP script this is a test The source code of the web page: php test Hi, I am a PHP script this is a test Is this an error with the explanation of the manual or is the apache-php configuration still at fault? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On Fri, 2010-08-20 at 10:00 +0100, e-letter wrote: > On 19/08/2010, Ashley Sheridan wrote: > > No, because Apache doesn't need to process HTML in the same way it needs > > to process PHP. The tag > browser as HTML (view the source on the page you're browsing to) and > > interpreted as a tag by your browser, hence what appears to be partially > > processed output. > > > > It's fairly clear by now that Apache does not know about your PHP > > install (if there even is one) > > > > I've just set up and installed PHP and Apache on my Mandriva box since > > I've been at home, and it took all of 5 minutes from within the package > > manager. Trust me, it's far easier to go that route than install the > > packages one-by-one as you seem to be doing as, unless you know exactly > > what packages you need, it's all too easy to miss installing something. > > > Yes that is what I was inspecting; I plan to re-install the entire OS. > You don't have to reinstall the entire OS, that's a very Windows approach to the problem. I played around a bit last night with urpmi and you should be able to just list the packages you need with urpmq --fuzzy package_name, and then install the ones listed you think you need. I did notice that urpmi doesn't install the DB when you install the Apache mod for that DB, so you might need to install that separately, but other than that, you should be good to go if you install the Apache php mod. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] tutorial failure
On 19/08/2010, Ashley Sheridan wrote: > No, because Apache doesn't need to process HTML in the same way it needs > to process PHP. The tag browser as HTML (view the source on the page you're browsing to) and > interpreted as a tag by your browser, hence what appears to be partially > processed output. > > It's fairly clear by now that Apache does not know about your PHP > install (if there even is one) > > I've just set up and installed PHP and Apache on my Mandriva box since > I've been at home, and it took all of 5 minutes from within the package > manager. Trust me, it's far easier to go that route than install the > packages one-by-one as you seem to be doing as, unless you know exactly > what packages you need, it's all too easy to miss installing something. > Yes that is what I was inspecting; I plan to re-install the entire OS. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On Thu, 2010-08-19 at 18:09 -0400, David McGlone wrote: > On Thu, 2010-08-19 at 22:24 +0100, Ashley Sheridan wrote: > > On Thu, 2010-08-19 at 19:04 +0100, e-letter wrote: > > > On 19/08/2010, HallMarc Websites wrote: > > > > I agree with the earlier take on this situation; you need to start at > > > > the > > > > beginning and learn the basics regarding the technologies BEFORE you > > > > try and > > > > manage them. You're trying to drive a car when you don't even know what > > > > or > > > > car is and how to operate one so you keep crashing. > > > > > > > > Here are some great sites to check out: > > > > http://wiki.mandriva.com/en/ > > > > http://www.pcstats.com/articleview.cfm?articleID=1868 > > > > http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL > > > > http://www.w3schools.com/ > > > > There are some great books out there as well to help you learn and I > > > > recommend getting the reference guides as well. Since the gist of this > > > > thread seems to be focused on the LAPP set-up and mainly an Apache (?) > > > > configuration issue you might try the forums and mailing lists found > > > > there > > > > as well. > > > > > > > No response from apache forum. Looking at the web browser output from > > > the processing of the php file, the partial success of processing the > > > file suggests that the problem is with php; if it was due to apache, > > > html code would be affected as well? > > > > > > > No, because Apache doesn't need to process HTML in the same way it > > needs to process PHP. The tag > your browser as HTML (view the source on the page you're browsing to) > > and interpreted as a tag by your browser, hence what appears to be > > partially processed output. > > > > It's fairly clear by now that Apache does not know about your PHP > > install (if there even is one) > > > This is my suspicion also. > > > > > I've just set up and installed PHP and Apache on my Mandriva box since > > I've been at home, and it took all of 5 minutes > > What was the name of the PHP package you installed? I E-Mailed him > offline and had him run the command rpm -q php5 to try and figure out if > php was installed and he replied with this: > > > > No package by this name in the repository; have libphp5_common5 > > installed. > > > Well I don't know what the name of the php5 in mandrake, so I can't tell > whether he's actually got php installed at all. > > > -- > Blessings, > David M. > > I used the GUI: K-Menu->Configure your Computer->Install & Remove Software Then searched for 'php', and the first package listed was apache-mod_php, which I installed along with the other php modules that I normally install (like GD, mcrypt, etc). The package manager sorts out dependencies very well. I'm not sure if installing over the command line with rpmi will deal with dependencies like this, and it certainly won't automatically install apache-mod_php if php is installed, as php doesn't necessarily *have* to run as a web server module, let alone as an Apache one specifically. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] tutorial failure
On Thu, 2010-08-19 at 22:24 +0100, Ashley Sheridan wrote: > On Thu, 2010-08-19 at 19:04 +0100, e-letter wrote: > > On 19/08/2010, HallMarc Websites wrote: > > > I agree with the earlier take on this situation; you need to start at the > > > beginning and learn the basics regarding the technologies BEFORE you try > > > and > > > manage them. You're trying to drive a car when you don't even know what or > > > car is and how to operate one so you keep crashing. > > > > > > Here are some great sites to check out: > > > http://wiki.mandriva.com/en/ > > > http://www.pcstats.com/articleview.cfm?articleID=1868 > > > http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL > > > http://www.w3schools.com/ > > > There are some great books out there as well to help you learn and I > > > recommend getting the reference guides as well. Since the gist of this > > > thread seems to be focused on the LAPP set-up and mainly an Apache (?) > > > configuration issue you might try the forums and mailing lists found there > > > as well. > > > > > No response from apache forum. Looking at the web browser output from > > the processing of the php file, the partial success of processing the > > file suggests that the problem is with php; if it was due to apache, > > html code would be affected as well? > > > > No, because Apache doesn't need to process HTML in the same way it > needs to process PHP. The tag your browser as HTML (view the source on the page you're browsing to) > and interpreted as a tag by your browser, hence what appears to be > partially processed output. > > It's fairly clear by now that Apache does not know about your PHP > install (if there even is one) This is my suspicion also. > > I've just set up and installed PHP and Apache on my Mandriva box since > I've been at home, and it took all of 5 minutes What was the name of the PHP package you installed? I E-Mailed him offline and had him run the command rpm -q php5 to try and figure out if php was installed and he replied with this: > No package by this name in the repository; have libphp5_common5 > installed. Well I don't know what the name of the php5 in mandrake, so I can't tell whether he's actually got php installed at all. -- Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On Thu, 2010-08-19 at 19:04 +0100, e-letter wrote: > On 19/08/2010, HallMarc Websites wrote: > > I agree with the earlier take on this situation; you need to start at the > > beginning and learn the basics regarding the technologies BEFORE you try and > > manage them. You're trying to drive a car when you don't even know what or > > car is and how to operate one so you keep crashing. > > > > Here are some great sites to check out: > > http://wiki.mandriva.com/en/ > > http://www.pcstats.com/articleview.cfm?articleID=1868 > > http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL > > http://www.w3schools.com/ > > There are some great books out there as well to help you learn and I > > recommend getting the reference guides as well. Since the gist of this > > thread seems to be focused on the LAPP set-up and mainly an Apache (?) > > configuration issue you might try the forums and mailing lists found there > > as well. > > > No response from apache forum. Looking at the web browser output from > the processing of the php file, the partial success of processing the > file suggests that the problem is with php; if it was due to apache, > html code would be affected as well? > No, because Apache doesn't need to process HTML in the same way it needs to process PHP. The tag http://www.ashleysheridan.co.uk
Re: [PHP] tutorial failure
On 19/08/2010, HallMarc Websites wrote: > I agree with the earlier take on this situation; you need to start at the > beginning and learn the basics regarding the technologies BEFORE you try and > manage them. You're trying to drive a car when you don't even know what or > car is and how to operate one so you keep crashing. > > Here are some great sites to check out: > http://wiki.mandriva.com/en/ > http://www.pcstats.com/articleview.cfm?articleID=1868 > http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL > http://www.w3schools.com/ > There are some great books out there as well to help you learn and I > recommend getting the reference guides as well. Since the gist of this > thread seems to be focused on the LAPP set-up and mainly an Apache (?) > configuration issue you might try the forums and mailing lists found there > as well. > No response from apache forum. Looking at the web browser output from the processing of the php file, the partial success of processing the file suggests that the problem is with php; if it was due to apache, html code would be affected as well? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] tutorial failure
-Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Thursday, August 19, 2010 11:33 AM To: e-letter Cc: David McGlone; php-general@lists.php.net Subject: Re: [PHP] tutorial failure On Thu, 2010-08-19 at 16:30 +0100, e-letter wrote: > On 19/08/2010, Ashley Sheridan wrote: > > As Colin suggested on another email, check to see if apache-mod_php was > > installed too. It seems likely that it wasn't for some reason. > > How to verify please? Also, the instruction to use task-lamp; it seems > this is for mysql but the database to be used is postgresql? Use the package manager to check and see if that was installed. I'm not familiar with the command line for rpmi, having used Yum on Fedora mostly, but on that you would just do a 'yum list apache-mod*' to see what apache mods were installed and available, so I assume something similar exists for rpmi. The task-lamp will be using MySQL, as it is the 'm' of lamp (Linux, Apache, MySQL & PHP) Thanks, Ash http://www.ashleysheridan.co.uk I agree with the earlier take on this situation; you need to start at the beginning and learn the basics regarding the technologies BEFORE you try and manage them. You're trying to drive a car when you don't even know what or car is and how to operate one so you keep crashing. Here are some great sites to check out: http://wiki.mandriva.com/en/ http://www.pcstats.com/articleview.cfm?articleID=1868 http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL http://www.w3schools.com/ There are some great books out there as well to help you learn and I recommend getting the reference guides as well. Since the gist of this thread seems to be focused on the LAPP set-up and mainly an Apache (?) configuration issue you might try the forums and mailing lists found there as well. I hope you find this helpful. Marc Hall HallMarc Websites "Well, if all else fails; read the directions." - Dear old Dad, RIP __ Information from ESET Smart Security, version of virus signature database 5379 (20100819) __ The message was checked by ESET Smart Security. http://www.eset.com __ Information from ESET Smart Security, version of virus signature database 5379 (20100819) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On Thu, 2010-08-19 at 16:30 +0100, e-letter wrote: > On 19/08/2010, Ashley Sheridan wrote: > > As Colin suggested on another email, check to see if apache-mod_php was > > installed too. It seems likely that it wasn't for some reason. > > How to verify please? Also, the instruction to use task-lamp; it seems > this is for mysql but the database to be used is postgresql? Use the package manager to check and see if that was installed. I'm not familiar with the command line for rpmi, having used Yum on Fedora mostly, but on that you would just do a 'yum list apache-mod*' to see what apache mods were installed and available, so I assume something similar exists for rpmi. The task-lamp will be using MySQL, as it is the 'm' of lamp (Linux, Apache, MySQL & PHP) Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] tutorial failure
On 19/08/2010, Ashley Sheridan wrote: > As Colin suggested on another email, check to see if apache-mod_php was > installed too. It seems likely that it wasn't for some reason. How to verify please? Also, the instruction to use task-lamp; it seems this is for mysql but the database to be used is postgresql? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On Thu, 2010-08-19 at 15:35 +0100, e-letter wrote: > On 19/08/2010, Ashley Sheridan wrote: > > I think it's fairly clear that for whatever reason, PHP isn't properly > > configured with Apache. You've mentioned you're using Mandriva, which, > > coincidentally, is what i've just recently installed on my home machine. > > It has a very good graphical package manager that you can use to install > > PHP and Apache. I'm not at my home machine right now, so I don't recall > > the exact name, but it's found somewhere in the Computer Settings main > > menu dialogue. From here, you can install Apache and PHP, which will > > configure Apache as well to recognise PHP scripts and execute them. > > > mcc (mandriva linux control centre) is the command (or more > specifically, rpmdrake) > > To my knowledge, using this tool, all necessary files are installed. I > suspect that there is a fault with the way that mandriva builds the > packages. As Colin suggested on another email, check to see if apache-mod_php was installed too. It seems likely that it wasn't for some reason. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] tutorial failure
On 19/08/2010, Ashley Sheridan wrote: > I think it's fairly clear that for whatever reason, PHP isn't properly > configured with Apache. You've mentioned you're using Mandriva, which, > coincidentally, is what i've just recently installed on my home machine. > It has a very good graphical package manager that you can use to install > PHP and Apache. I'm not at my home machine right now, so I don't recall > the exact name, but it's found somewhere in the Computer Settings main > menu dialogue. From here, you can install Apache and PHP, which will > configure Apache as well to recognise PHP scripts and execute them. > mcc (mandriva linux control centre) is the command (or more specifically, rpmdrake) To my knowledge, using this tool, all necessary files are installed. I suspect that there is a fault with the way that mandriva builds the packages. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On Thu, 2010-08-19 at 09:41 +0100, e-letter wrote: > On 19/08/2010, David McGlone wrote: > > On Wed, 2010-08-18 at 23:08 +0100, e-letter wrote: > >> On 18/08/2010, David McGlone wrote: > >> > On Wed, 2010-08-18 at 21:54 +0100, e-letter wrote: > >> >> On 18/08/2010, David McGlone wrote: > >> >> > > >> >> > Do you have php5 installed? > >> >> > > >> >> Yes, but don't know how to confirm; I used urpmi to install. > >> > > >> > Use the command in a terminal: rpm -q php5 > >> > > >> No package by this name in the repository; have libphp5_common5 installed. > > > > Ok let me ask you this, When you try to view a php file on your server > > does it ask you if you would like to download it? > > I don't understand: isn't the example I provided a php file? > I think it's fairly clear that for whatever reason, PHP isn't properly configured with Apache. You've mentioned you're using Mandriva, which, coincidentally, is what i've just recently installed on my home machine. It has a very good graphical package manager that you can use to install PHP and Apache. I'm not at my home machine right now, so I don't recall the exact name, but it's found somewhere in the Computer Settings main menu dialogue. From here, you can install Apache and PHP, which will configure Apache as well to recognise PHP scripts and execute them. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] tutorial failure
On 19/08/2010, David McGlone wrote: > On Wed, 2010-08-18 at 23:08 +0100, e-letter wrote: >> On 18/08/2010, David McGlone wrote: >> > On Wed, 2010-08-18 at 21:54 +0100, e-letter wrote: >> >> On 18/08/2010, David McGlone wrote: >> >> > >> >> > Do you have php5 installed? >> >> > >> >> Yes, but don't know how to confirm; I used urpmi to install. >> > >> > Use the command in a terminal: rpm -q php5 >> > >> No package by this name in the repository; have libphp5_common5 installed. > > Ok let me ask you this, When you try to view a php file on your server > does it ask you if you would like to download it? I don't understand: isn't the example I provided a php file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] tutorial failure
From: e-letter > On 19/08/2010, David McGlone wrote: > >> Yes it is. But your computer needs the correct software to view that php >> file in a web browser as if it was a web page. If you do not have this >> software installed, then the web browser will ask you if you want to >> download the file instead. >> > The web browser views the php file as described previously; there is > no prompt to download the file. David, If the server is set up correctly, it interprets the PHP code and only sends an HTML stream to the browser. The only way the browser would see PHP is if the server is misconfigured. The browser will simply display it as it would HTML. It doesn't know PHP from plain text. Actually, the browser could not process PHP, since most of the resources needed are still on the server. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On 19/08/2010, David McGlone wrote: > Yes it is. But your computer needs the correct software to view that php > file in a web browser as if it was a web page. If you do not have this > software installed, then the web browser will ask you if you want to > download the file instead. > The web browser views the php file as described previously; there is no prompt to download the file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On 18/08/2010, Bob McConnell wrote: > From: e-letter > >> On 18/08/2010, chris h wrote: >>> On Wed, Aug 18, 2010 at 7:10 AM, e-letter wrote: >>> On 18/08/2010, chris h wrote: > What are the actual file permissions when you run ls -o? > root >>> >>> What's the entire output of ls -o? >>> >> [r...@localhost html]# ls -o * >> -rwxr-xr-x 1 root 182 2010-08-18 11:33 test.php* >> >> addon-modules: >> total 4 >> lrwxrwxrwx 1 root 51 2010-01-11 22:03 apache-mod_svn_view-0.1.0 -> >> ../../../../usr/share/doc/apache-mod_svn_view-0.1.0 >> lrwxrwxrwx 1 root 52 2010-01-11 22:03 apache-mod_transform-0.6.0 -> >> ../../../../usr/share/doc/apache-mod_transform-0.6.0 >> -rw-r--r-- 1 root 115 2007-09-07 21:47 HOWTO_get_modules.html >> >>> > > Do you know if PHP is installed as an apache mod or cgi? Also you > might > check what user apache is running as. > No. How to verify? > possibly... > $ vi /etc/apache2/envvars > No apache2 on my computer, only '/usr/lib/apache' which contains > only .so files. >>> >>> there's no /etc/apache either? >>> >> No > > Some distributions have really screwed up the locations of various > applications. This is compounded by the decision to rename the Apache 2 > directories to httpd. Look for /etc/httpd, /home/httpd or > /usr/lib/httpd. If worse comes to worst, try > In '/etc/httpd/conf' there is an empty directory 'addon-modules'. In /usr/lib/apache-extramodules there is 'mod_php5.so'. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] tutorial failure
From: e-letter > On 18/08/2010, chris h wrote: >> On Wed, Aug 18, 2010 at 7:10 AM, e-letter wrote: >> >>> On 18/08/2010, chris h wrote: >>> > What are the actual file permissions when you run ls -o? >>> > >>> root >>> >> >> What's the entire output of ls -o? >> > [r...@localhost html]# ls -o * > -rwxr-xr-x 1 root 182 2010-08-18 11:33 test.php* > > addon-modules: > total 4 > lrwxrwxrwx 1 root 51 2010-01-11 22:03 apache-mod_svn_view-0.1.0 -> > ../../../../usr/share/doc/apache-mod_svn_view-0.1.0 > lrwxrwxrwx 1 root 52 2010-01-11 22:03 apache-mod_transform-0.6.0 -> > ../../../../usr/share/doc/apache-mod_transform-0.6.0 > -rw-r--r-- 1 root 115 2007-09-07 21:47 HOWTO_get_modules.html > >> >>> > >>> > Do you know if PHP is installed as an apache mod or cgi? Also you might >>> > check what user apache is running as. >>> > >>> No. How to verify? >>> >>> > possibly... >>> > $ vi /etc/apache2/envvars >>> > >>> No apache2 on my computer, only '/usr/lib/apache' which contains only .so >>> files. >>> >> >> there's no /etc/apache either? >> > No Some distributions have really screwed up the locations of various applications. This is compounded by the decision to rename the Apache 2 directories to httpd. Look for /etc/httpd, /home/httpd or /usr/lib/httpd. If worse comes to worst, try ps ax | grep httpd to see if you can find the path from the original start up in the init process. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On 18/08/2010, Ashley Sheridan wrote: > On Wed, 2010-08-18 at 12:10 +0100, e-letter wrote: > >> On 18/08/2010, chris h wrote: >> > What are the actual file permissions when you run ls -o? >> > >> root >> > >> > Do you know if PHP is installed as an apache mod or cgi? Also you might >> > check what user apache is running as. >> > >> No. How to verify? >> >> > possibly... >> > $ vi /etc/apache2/envvars >> > >> No apache2 on my computer, only '/usr/lib/apache' which contains only .so >> files. >> > > > ls -o doesn't give one word answers, so again, what is the output of an > ls -o call in your shell? > > I assume that root is the owner of the file here, and the fact that > you're getting some output from it seems to suggest that at least read > permissions are available for group and other, but you should check to > see if the permissions are indeed something like 664 (-rw-rw-r--) > > What OS are you using? I'm assuming a Linux distro of some kind here, > but it could also be another Unix variant. Have you tried using the > package manager within the distro (if it is Linux) to install PHP and > Apache together? That makes it a lot easier to get up and running with a > decent configuration, especially if you're unfamiliar with the more > complicated details. > I used urpmi with mandriva -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On Wed, 2010-08-18 at 12:10 +0100, e-letter wrote: > On 18/08/2010, chris h wrote: > > What are the actual file permissions when you run ls -o? > > > root > > > > Do you know if PHP is installed as an apache mod or cgi? Also you might > > check what user apache is running as. > > > No. How to verify? > > > possibly... > > $ vi /etc/apache2/envvars > > > No apache2 on my computer, only '/usr/lib/apache' which contains only .so > files. > ls -o doesn't give one word answers, so again, what is the output of an ls -o call in your shell? I assume that root is the owner of the file here, and the fact that you're getting some output from it seems to suggest that at least read permissions are available for group and other, but you should check to see if the permissions are indeed something like 664 (-rw-rw-r--) What OS are you using? I'm assuming a Linux distro of some kind here, but it could also be another Unix variant. Have you tried using the package manager within the distro (if it is Linux) to install PHP and Apache together? That makes it a lot easier to get up and running with a decent configuration, especially if you're unfamiliar with the more complicated details. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] tutorial failure
On 18/08/2010, chris h wrote: > On Wed, Aug 18, 2010 at 7:10 AM, e-letter wrote: > >> On 18/08/2010, chris h wrote: >> > What are the actual file permissions when you run ls -o? >> > >> root >> > > What's the entire output of ls -o? > [r...@localhost html]# ls -o * -rwxr-xr-x 1 root 182 2010-08-18 11:33 test.php* addon-modules: total 4 lrwxrwxrwx 1 root 51 2010-01-11 22:03 apache-mod_svn_view-0.1.0 -> ../../../../usr/share/doc/apache-mod_svn_view-0.1.0 lrwxrwxrwx 1 root 52 2010-01-11 22:03 apache-mod_transform-0.6.0 -> ../../../../usr/share/doc/apache-mod_transform-0.6.0 -rw-r--r-- 1 root 115 2007-09-07 21:47 HOWTO_get_modules.html > >> > >> > Do you know if PHP is installed as an apache mod or cgi? Also you might >> > check what user apache is running as. >> > >> No. How to verify? >> >> > possibly... >> > $ vi /etc/apache2/envvars >> > >> No apache2 on my computer, only '/usr/lib/apache' which contains only .so >> files. >> > > there's no /etc/apache either? > No -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On Wed, Aug 18, 2010 at 7:10 AM, e-letter wrote: > On 18/08/2010, chris h wrote: > > What are the actual file permissions when you run ls -o? > > > root > What's the entire output of ls -o? > > > > Do you know if PHP is installed as an apache mod or cgi? Also you might > > check what user apache is running as. > > > No. How to verify? > > > possibly... > > $ vi /etc/apache2/envvars > > > No apache2 on my computer, only '/usr/lib/apache' which contains only .so > files. > there's no /etc/apache either?
Re: [PHP] tutorial failure
On 18/08/2010, chris h wrote: > What are the actual file permissions when you run ls -o? > root > > Do you know if PHP is installed as an apache mod or cgi? Also you might > check what user apache is running as. > No. How to verify? > possibly... > $ vi /etc/apache2/envvars > No apache2 on my computer, only '/usr/lib/apache' which contains only .so files. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
What are the actual file permissions when you run ls -o? Do you know if PHP is installed as an apache mod or cgi? Also you might check what user apache is running as. possibly... $ vi /etc/apache2/envvars and look for something like... export APACHE_RUN_USER=www-data On Wed, Aug 18, 2010 at 6:47 AM, e-letter wrote: > On 18/08/2010, chris h wrote: > > php is not processing the file. There's a few reasons for this, but the > > first thing I would check is the permissions of the file. From the > > directory try > > > > $ ls -oa > > > The file permission was confirmed as root, since it was copied (as > root) from a normal user account directorp 'temporary' to the > directory '/var/www/html' > > > This should tell you who owns the file and what it's permissions are. > You > > mentioned that you copied it as root, you could change it's ownership to > > www-data. > > > This fails: > > [r...@localhost html]# chown www-data test.php > chown: `www-data': invalid user > > So I repeated this with a normal user account and the change in > permission occurs. However, the html file containing the php script > remains unchanged. > > The instruction: > > ... > > ... > > Does not show the version of php. >
Re: [PHP] tutorial failure
On 18/08/2010, Peter Lind wrote: > On 18 August 2010 12:47, e-letter wrote: >> On 18/08/2010, chris h wrote: >>> php is not processing the file. There's a few reasons for this, but the >>> first thing I would check is the permissions of the file. From the >>> directory try >>> >>> $ ls -oa >>> >> The file permission was confirmed as root, since it was copied (as >> root) from a normal user account directorp 'temporary' to the >> directory '/var/www/html' >> >>> This should tell you who owns the file and what it's permissions are. >>> You >>> mentioned that you copied it as root, you could change it's ownership to >>> www-data. >>> >> This fails: >> >> [r...@localhost html]# chown www-data test.php >> chown: `www-data': invalid user >> >> So I repeated this with a normal user account and the change in >> permission occurs. However, the html file containing the php script >> remains unchanged. >> >> The instruction: >> >> ... >> >> ... >> >> Does not show the version of php. >> > > Your webserver might not be configured to process php files - which > server are you using? > Apache. Below is an extract of an (to now) unanswered question: ... SetHandler application/x-httpd-php http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On 18 August 2010 12:47, e-letter wrote: > On 18/08/2010, chris h wrote: >> php is not processing the file. There's a few reasons for this, but the >> first thing I would check is the permissions of the file. From the >> directory try >> >> $ ls -oa >> > The file permission was confirmed as root, since it was copied (as > root) from a normal user account directorp 'temporary' to the > directory '/var/www/html' > >> This should tell you who owns the file and what it's permissions are. You >> mentioned that you copied it as root, you could change it's ownership to >> www-data. >> > This fails: > > [r...@localhost html]# chown www-data test.php > chown: `www-data': invalid user > > So I repeated this with a normal user account and the change in > permission occurs. However, the html file containing the php script > remains unchanged. > > The instruction: > > ... > > ... > > Does not show the version of php. > Your webserver might not be configured to process php files - which server are you using? Regards Peter -- WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind BeWelcome/Couchsurfing: Fake51 Twitter: http://twitter.com/kafe15 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On 18/08/2010, chris h wrote: > php is not processing the file. There's a few reasons for this, but the > first thing I would check is the permissions of the file. From the > directory try > > $ ls -oa > The file permission was confirmed as root, since it was copied (as root) from a normal user account directorp 'temporary' to the directory '/var/www/html' > This should tell you who owns the file and what it's permissions are. You > mentioned that you copied it as root, you could change it's ownership to > www-data. > This fails: [r...@localhost html]# chown www-data test.php chown: `www-data': invalid user So I repeated this with a normal user account and the change in permission occurs. However, the html file containing the php script remains unchanged. The instruction: ... ... Does not show the version of php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
php is not processing the file. There's a few reasons for this, but the first thing I would check is the permissions of the file. From the directory try $ ls -oa This should tell you who owns the file and what it's permissions are. You mentioned that you copied it as root, you could change it's ownership to www-data. again from the directory try. $ chown www-data test.php then run ls -oa to ensure the change took place. Chris. On Wed, Aug 18, 2010 at 6:03 AM, e-letter wrote: > I changed the code as follows: > > > >php test > > > > > echo "Hi, I am a PHP script"; >?> > >this is a test > > > > > The result (http://localhost/test.php): > > Hi, I am a PHP script > > "; ?> > > this is a test > > If I use single quotes characters: > > Hi, I am a PHP script > > '; ?> > > this is a test > > The phpinfo instruction does not seem to be recognised. What else > should I check? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] tutorial failure
I changed the code as follows: php test Hi, I am a PHP script"; ?> this is a test The result (http://localhost/test.php): Hi, I am a PHP script "; ?> this is a test If I use single quotes characters: Hi, I am a PHP script '; ?> this is a test The phpinfo instruction does not seem to be recognised. What else should I check? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tutorial failure
On 18 August 2010 10:44, e-letter wrote: > Readers, > > Copy below of message sent 15 August to php install digest list, but > to date not including in mail archive? > > The tutorial example: > > > > php test > > > echo 'Hi, I am a PHP script'; > ?> > > this is a test > > > > > is saved to the normal user temporary folder as 'test.php' and then > copied to the folder '/var/www/html/' using the root user account. The > web browser is directed to url 'http://localhost.test.php, to show: > > Hi, I am a PHP script > > '; ?> > > this is a test > > What is the error please? Looks like a problem with quotes, I'd say. > Urpmi was used to install so the php version installed is not known. > How to obtain this please Check with php -i from the command line or a script containing phpinfo(); requested through the browser. Regards Peter -- WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind BeWelcome/Couchsurfing: Fake51 Twitter: http://twitter.com/kafe15 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] tutorial failure
-Original Message- From: e-letter [mailto:inp...@gmail.com] Sent: 18 August 2010 10:44 AM To: php-general@lists.php.net Subject: [PHP] tutorial failure Readers, Copy below of message sent 15 August to php install digest list, but to date not including in mail archive? The tutorial example: php test Hi, I am a PHP script'; ?> this is a test is saved to the normal user temporary folder as 'test.php' and then copied to the folder '/var/www/html/' using the root user account. The web browser is directed to url 'http://localhost.test.php, to show: Hi, I am a PHP script '; ?> this is a test What is the error please? Urpmi was used to install so the php version installed is not known. How to obtain this please -- Shouldn't that be http://localhost/test.php Cheers Arno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php