LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2003, 09:57 AM   #1
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Rep: Reputation: 15
Question What is parse error ?


Hi

Got this error when executing php:

Parse error: parse error, unexpected $ in /data/web/mydomain/popdisplay.php on line 162


<?php
require "config.php";
$dbConnect = mysql_pconnect(null,$dbUserName ,$dbPassword);
if($flag=="1"){

if($MainArea!='SelectOne'){

if($AreaID!='SelectOne'){
?>
<script>
window.opener.top.main.location="display_details.php?area=<? echo urlencode($AreaID); ?>&mes=1";
window.close();
</script>
..................


The config.php is :

<?
$dbUserName = "mysql";
$dbPassword = "mypass";
$dbConnect =0;
//the next two setting items for upload picture
$PicturePath = "/mydomain/UploadPicture/";
$PicturePhysicalPath="/var/www/html/mydomain/UploadPicture/";
$HostIP="192.168.1.118";

function gotoURL($url)
{
echo "<script language='javascript'>" ;
echo "location.href='" . $url . "'";
echo "</script>";
}

function popupMsg($msg)
{
echo "<script language='javascript'>" ;
echo "alert('" . $msg . "')";
echo "</script>";
}

function gotoBack()
{
echo "<script language='javascript'>" ;
echo "history.back()";
echo "</script>";
}

function gotoFrameURL($index,$url)
{
echo "<script language='javascript'>" ;
echo "window.frames(" . $index . ").location.href='" . $url . "'";
echo "</script>";
}

?>

--------------------

Any idea? When I execute other php codes, it simply shows the codes instead of the graphic mode.

Please advice!

Thank you.

Regards
Edward Han
 
Old 09-10-2003, 10:04 AM   #2
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Re: What is parse error ?

Quote:
Originally posted by edhan
Hi

Got this error when executing php:

Parse error: parse error, unexpected $ in /data/web/mydomain/popdisplay.php on line 162


<?php
require "config.php";
$dbConnect = mysql_pconnect(null,$dbUserName ,$dbPassword);
if($flag=="1"){

if($MainArea!='SelectOne'){

if($AreaID!='SelectOne'){
?>
<script>
window.opener.top.main.location="display_details.php?area=<? echo urlencode($AreaID); ?>&mes=1";
window.close();
</script>
..................


The config.php is :

<?
$dbUserName = "mysql";
$dbPassword = "mypass";
$dbConnect =0;
//the next two setting items for upload picture
$PicturePath = "/mydomain/UploadPicture/";
$PicturePhysicalPath="/var/www/html/mydomain/UploadPicture/";
$HostIP="192.168.1.118";

function gotoURL($url)
{
echo "<script language='javascript'>" ;
echo "location.href='" . $url . "'";
echo "</script>";
}

function popupMsg($msg)
{
echo "<script language='javascript'>" ;
echo "alert('" . $msg . "')";
echo "</script>";
}

function gotoBack()
{
echo "<script language='javascript'>" ;
echo "history.back()";
echo "</script>";
}

function gotoFrameURL($index,$url)
{
echo "<script language='javascript'>" ;
echo "window.frames(" . $index . ").location.href='" . $url . "'";
echo "</script>";
}

?>

--------------------

Any idea? When I execute other php codes, it simply shows the codes instead of the graphic mode.

Please advice!

Thank you.

Regards
Edward Han
1. A parse error is a code, which php doesn't know. Or an unespected character....which can not be combined with other codes.

2. You say: When I execute other php codes, it simply shows the codes instead of the graphic mode.

It does mean that or: the php module for apache is not installed
or: something is wrong with the file types in your httpd.conf, or if you use apache2: commonapache2.conf

What apache version do you use ?
What distro ?
What php version ?

Last edited by daveo; 09-10-2003 at 10:07 AM.
 
Old 09-10-2003, 10:57 AM   #3
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi

Using Apache : 2.0.40

PHP : 4.2.2-8.0.5

What do I need to check to resolve? httpd.conf ?

Thanks!

Regards
Edward Han
 
Old 09-10-2003, 11:04 AM   #4
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Quote:
Originally posted by edhan
Hi

Using Apache : 2.0.40

PHP : 4.2.2-8.0.5

What do I need to check to resolve? httpd.conf ?

Thanks!

Regards
Edward Han
Edward,

I've written a article, howto install apache php mysql mod_ssl
it can be found at: http://www.linuxaddicted.org/index.p...etarticle&id=2 and reffer to the install part of PHP in the manual.. there's also a way explained, how you can check whether PHP is installed and working or not ... I suggest that you should read the whole article. If you got any questions afterwards, let me know ...
 
Old 09-10-2003, 10:29 PM   #5
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi Dave

Read your article: http://www.linuxaddicted.org/index....getarticle&id=2

and follow the procedure to install. [I have re-install a fresh new setup for this].

But I have encountered these errors:

After running this:
SSL_BASE=../openssl-0.9.7b ./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max --enable-module=ssl --enable-shared=ssl

I try to make the binarys... and has the error shown as:
Entering directory '/usr/local/apache_1.3.27'
Entering directory '/usr/local/apache_1.3.27/src'
** No rule to make target 'all'. Stop
Leaving directory '/usr/local/apache_1.3.27/src'
*** [build-std] error 2
Leaving directory '/usr/local/apache_1.3.27
*** [build] Error 2

--------------

When installing PHP with the command:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --enable-versioning --with-mysql=/usr/local --enable-ftp --enable-bcmath --disable-debug --enable-memory-limit=yes --enable-track-vars

I have the following errors:


Sorry, I was not able to successfully run apxs. Possible reasons:
1. Perl is not installed {confirm that it is installed}
2. Apache was not compiled with DSO support (--enable-module=so)
3. 'apxs' is not in your path. try to use --with-apxs=/path/to/apxs

The output of /usr/local/apache/bin/apxs follows
./configure: line 3215: /usr/local/apache/bin/apxs: No such file or directory
Configure: error: Aborting


When using make and install PHP, I have the errors:

*** No targets specific and no makefile found. Stop
*** No rule to make target 'install' Stop.

Please advice how I can install without errors for the above. I have not proceed further since it did not complete the above.

Thanks!

Regards
Edward Han
 
Old 09-11-2003, 02:46 AM   #6
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Quote:
Originally posted by edhan
Hi Dave

and follow the procedure to install. [I have re-install a fresh new setup for this].

But I have encountered these errors:

After running this:
SSL_BASE=../openssl-0.9.7b ./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max --enable-module=ssl --enable-shared=ssl

I try to make the binarys... and has the error shown as:
Entering directory '/usr/local/apache_1.3.27'
Entering directory '/usr/local/apache_1.3.27/src'
** No rule to make target 'all'. Stop
Leaving directory '/usr/local/apache_1.3.27/src'
*** [build-std] error 2
Leaving directory '/usr/local/apache_1.3.27
*** [build] Error 2

When installing PHP with the command:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --enable-versioning --with-mysql=/usr/local --enable-ftp --enable-bcmath --disable-debug --enable-memory-limit=yes --enable-track-vars

I have the following errors:

Sorry, I was not able to successfully run apxs. Possible reasons:
1. Perl is not installed {confirm that it is installed}
2. Apache was not compiled with DSO support (--enable-module=so)
3. 'apxs' is not in your path. try to use --with-apxs=/path/to/apxs

The output of /usr/local/apache/bin/apxs follows
./configure: line 3215: /usr/local/apache/bin/apxs: No such file or directory
Configure: error: Aborting


When using make and install PHP, I have the errors:

*** No targets specific and no makefile found. Stop
*** No rule to make target 'install' Stop.

Edward Han
--Sleepy-me-edit-my-post-again--

I see that you've typed "make all" instead of what's in the manual "make" right ? it complains that: ** No rule to make target 'all'. Stop

1. Cleanup the system and re-install all packages again. (incl source)
Cleaning source packages can be done by: /usr/src/www/apache then type "make clean"

Hope this helps

Last edited by daveo; 09-11-2003 at 03:28 AM.
 
Old 09-11-2003, 05:41 AM   #7
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi Dave

No. I did not isssue make all. I followed your article and issue the command make. That is the error I have got. Anyway, I will re-install the entire RH8.0 again and see if I encounter the same error.

I will be back again after re-installation to let you know if there is still error.

Regards
Edward Han
 
Old 09-11-2003, 05:54 AM   #8
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Quote:
Originally posted by edhan
Hi Dave

No. I did not isssue make all. I followed your article and issue the command make. That is the error I have got. Anyway, I will re-install the entire RH8.0 again and see if I encounter the same error.

I will be back again after re-installation to let you know if there is still error.

Regards
Edward Han
Edward,

I did not mention re-install your system, but only the packages and sources of the packages.

Does it give error messages afther the: SSL_BASE=../openssl-0.9.7 ./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max --enable-module=ssl --enable-shared=ssl
?
 
Old 09-11-2003, 07:13 AM   #9
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by daveo
Edward,

I did not mention re-install your system, but only the packages and sources of the packages.

Does it give error messages afther the: SSL_BASE=../openssl-0.9.7 ./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max --enable-module=ssl --enable-shared=ssl
?
No. It didn't give error. Only when I try the command: make

Then it gave the error as mentioned earlier.

I have re-installed the entire server. Will try again and see if the error appears when issuing the command: make

Thanks!

Regards
Edward Han
 
Old 09-11-2003, 07:51 AM   #10
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 457

Rep: Reputation: 41
Edward,

Please note. It is a rare day indeed when a person has to reinstall the entire system on Linux. Perhaps a major disk crash, but even then one should only have to "restore" the system from backups.

Most pieces of the system are generally independent. Note that this architecture sometimes leads to the "dependency" problems people run into, which means a person just has to add and configure the new required part. Such a minor hassle is far out-weighed by the stability (and resilience) of the Linux system.
 
Old 09-11-2003, 08:15 AM   #11
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi fsbooks

I am new to Linux and get very frustrated as my Web Server went down [crashed] and have to re-install the entire server. This server was installed by another person and can't be contacted so I have to do it all by myself. Indeed it is a very tough task as I completely have no knowledge of Linux. After numerous installation, I am getting a little passion out of it as I am impressive with it though I am still unable to get it running and working as it should be in the first place.

Anyway, I am still in the progressing of re-installing the entire server in accordance to Dave's article and see if my php can login to the mysql database. This is my 12 times of re-installing since the beginning of this week [Monday] and hopefully I can restore it to run before the end of this week.

This time, I hope I will not encounter any error with the re-installation.

Regards
Edward Han
 
Old 09-11-2003, 10:01 AM   #12
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi Dave

I have completed the re-installation without ERRORS.

But when I do the index.php for the <? phpinfo(); ?>, it didn't show up.

If I simply type: http://localhost
I can see the message from Apache with openssl, mod_ssl logo.

I can also login as IP Addres: http://192.168.1.118

I have tested with my database, it still shows the codes.

Arrggghhh! How do I resolve this??? I thought after re-installing without errors, I will be able to get the system up. But again, I am disappointed!

Also, I have installed the Webmin, it seems like the path for MySQL Server and Apache Server are not the same. So, do I use symbolic link for both of them if I want to use them to do changes? Or what do you recommend for remote web browser editing software ? Please advice.

Regards
Edward Han

Last edited by edhan; 09-11-2003 at 10:06 AM.
 
Old 09-11-2003, 10:17 AM   #13
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Quote:
Originally posted by edhan
Hi Dave

I have completed the re-installation without ERRORS.

But when I do the index.php for the <? phpinfo(); ?>, it didn't show up.

If I simply type: http://localhost
I can see the message from Apache with openssl, mod_ssl logo.

I can also login as IP Addres: http://192.168.1.118

I have tested with my database, it still shows the codes.

Arrggghhh! How do I resolve this??? I thought after re-installing without errors, I will be able to get the system up. But again, I am disappointed!

Also, I have installed the Webmin, it seems like the path for MySQL Server and Apache Server are not the same. So, do I use symbolic link for both of them if I want to use them to do changes? Or what do you recommend for remote web browser editing software ? Please advice.

Regards
Edward Han
First congratulations!
Second .. you say: But when I do the index.php for the <? phpinfo(); ?>, it didn't show up."

Hmm do you see only the code ?

Does the php.ini exists in /usr/local/apache/conf ?
if not do: locate php.ini (it might also be located in /etc/apache) then copy php.ini to /usr/local/apache/conf/

Stop and start the server ...and try again.

Personally I'm not using any software to administrate Apache, for MySQL I use phpmyadmin ....:-P

Hope this helps
 
Old 09-11-2003, 10:53 AM   #14
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by daveo
First congratulations!
Second .. you say: But when I do the index.php for the <? phpinfo(); ?>, it didn't show up."

Hmm do you see only the code ?

Nope. I see a blank screen. But if I look into the source, I can see the codes.

Does the php.ini exists in /usr/local/apache/conf ?
if not do: locate php.ini (it might also be located in /etc/apache) then copy php.ini to /usr/local/apache/conf/

Yes. I have copied the php.ini from /etc/php.ini to the /usr/local/apache/conf/

Stop and start the server ...and try again.

Personally I'm not using any software to administrate Apache, for MySQL I use phpmyadmin ....:-P

Okay. If I want to do the same as you, can I let it auto starting the necessary stuff like executing httpd [apache server], mysql without doing it manually like what I am doing now ?

Hope this helps
Thanks!

Regards
Edward Han
 
Old 09-11-2003, 11:03 AM   #15
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Quote:
Originally posted by edhan
Thanks!

Regards
Edward Han
1. Does it all work now ?

2. Yes you can. I thought you're running redhat huh?. To configure the httpd service to start up at boot time using an initscript utility, such as /sbin/chkconfig, /sbin/ntsysv, or the Services Configuration tool program. I thought that mysql can be added also this way ...correct me if i'm wrong.

Hope that all works for you now..[sleepy me edit again]


Last edited by daveo; 09-11-2003 at 11:07 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse Error, but why? Mistro116@yahoo.com Programming 2 11-13-2005 03:38 PM
in gcc compiler error: parse error before string constsnt cynthia_thomas Linux - Networking 1 10-20-2005 02:29 AM
parse error with bc fisayo Programming 7 08-04-2005 10:23 AM
Parse Error verbatim Programming 3 04-22-2005 10:16 AM
Parse Error in G++ ashwinipahuja Programming 1 04-29-2004 02:47 AM


All times are GMT -5. The time now is 06:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration