Jump to content

Fatal error issue [RESOLVED]


Matvan

Recommended Posts

Greetings

This is my third post it is exactly the same as the post made yesterday and the day before. As I have only just joined the forum I have no way of knowing if my posts got through, got binned, haven't been moderated or whatever.

I am in the process of setting up phpVMS for my VA, The MATVA Group. Things are going reasonably well and with a bit of application I have so far managed to solve most of the issues I have come across.

We do intend to use Kacars, and the 20 flights I have flown and posted have gone without a hitch, but I need to allow for pireps flown without Kacars. Unfortunately when I click on the 'File a New PIREP' link in the header I get a new page with:-

"Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 6149840 bytes) in /home/sites/matva.org/public_html/vamanage/core/classes/CodonCache.class.php on line 202"

at the top of the page. Accessing that particular file with Dreamweaver shows line 202 to read "$value = serialize($value);"

As the last programming I did was with dBaseIII I don't know what the problem is other than that seems to be an awful lot of bytes to allocate for a pirep.

Your assistance would be appreciated. Many thanks in advance.

PS I have zero'd everything again as you can see by the "badge". The problem was occurring before the cleanout. My previous attempts to join the forum and put the question went adrift somehow.

Louie

The MATVA Group

  • Like 1
Link to comment
Share on other sites

Thanks for the responses folks, if I interpret the information in the post PilotChase points to correctly then the problem lies with the amount of memory available to the application. That particular post seems to deal with a different issue albeit with a similar result. Reading elsewhere the fault appears to be quite common with php.

Next question. My host does appear to allocate minimal memory (32m by default). What is the best way to deal with the issue. Do I create a php.ini file in my server side root directory and set the memory in that or can I set the memory within the php file calling the routine. I notice there isn't a php.ini anywhere within phpVMS itself.

Once again thanks for the responses.

Louie

Link to comment
Share on other sites

My host is UK outfit Cloudnext. Looking through their help section 32M is set by default, they don't say anything about an upper limit. I found the info about putting the php.ini in the server side root directory in their help files too, so taking that into consideration they must be familiar with the issue. Anyway I will give their method a try and see if the situation gets resolved. B)

Link to comment
Share on other sites

Greetings once again folks.

I have now increased the memory available to 256mb and the page is loading, albeit quite slowly. I may be on the wrong track but could the delayed loading may be caused by the airport database. Also, when I try to select an airport from the drop down it takes a relative age to reveal (airport database has in the region of 45000 entries).

Would placing the php.ini in the same directory as the file being called make a difference, or is it just a case of firing memory at the problem. If all else fails would it be possible to just enter an ICAO like with the Kacars app as I can't see my lads being very enamoured with the way the "File a New PIREP" page is running at the moment. Please note I am no programmer.

thanks in advance

Louie

Link to comment
Share on other sites

  • Moderators

Unfortunately you can't load so easily so much entries twice. I would suggest you to remove the airports which are not used by your virtual airline and just create a new one with icao AAAA (for example). So if the pilot can't find an airport, he can use AAAA and just write down on the comments part his departure and arrival airport (DEP/LGAV ARR/LGTS). During the validation progress, you would be able to edit the departure and arrival airports. That is just a suggestion and i think that it is an alternative way to allow your pilots to fly between whichever airport they want.

Let me tell you that someone had edited the File a new PIREP page and did the departure and arrival airport text fields from drop down menus. I think that this is also a good solution.

Link to comment
Share on other sites

I think you may be right servetas. I increased the available memory to 1024 with no discernible improvement. The dropdown boxes for the airline and aircraft fields work fine but the airport ones are struggling to the point of getting nowhere.

Unfortunately The MATVA Group has been around for over ten years and our current route network operates 25 divisions and 4 service operations with 863 aircraft flying the best part of 14,000 legs, these figures are increasing pretty much daily. Editing the airport database may well have to be a last resort although trimming it some may not be a bad idea. Database was built using the information from ourairports.com. I still think removing the airport dropdowns to be the best solution. So if someone could let me know what I need to do to make the dropdown departure and arrival fields into single entry ones I would be very grateful.

Once again many thanks

Link to comment
Share on other sites

  • Moderators

Check this: http://forum.phpvms.net/topic/1152-how-to-do-dynamic-non-scheduled-routes/#entry9245

I would suggest you to read the whole thread because there are some instructions you have to follow as soon as you install it (for example, you should not use the recalculate distances function etc...).

Link to comment
Share on other sites

Greets Flyalaska

At the moment there are no pireps. After ten years of manual posting we are moving forward, I hope!

I did fly 20 test routes to make sure there were no issues with Kacars, but after they were completed I zeroed everything. Except of course the airport database. I am inclined to agree with 'servetas' in that asking the pirep page to load the airport database twice may be a bit much, on viewing the source of the actual page you can see all the airports in a massive block of text within it. As we aren't interested in a schedule system the losing of the dropdown airport selection isn't an issue and to be honest I don't really want to enter of all our routes into the system anyway. One of the reasons I baulked at other auto-pirep systems was that they required routes to be entered. That would have been ok back in 2004 when we started up, but it's a major undertaking now.

Once again thanks for the input.

Link to comment
Share on other sites

Greetings again folkses

I have modified the pirep template servetas links to above. On the face of it it looks ok but there is a problem as it tells me I haven't filled out all the fields. I'm pretty sure the problem lies with the un-needed bid string in the aircraft selection section, but I'm afraid I'm not particularly php friendly and can't see what I have to take out to leave me with only the pertinent aircraft information. Could any of you kind folks please help me out?

my current pirep_new.tpl template below

<h3>File a Flight Report</h3>
<?php
if(isset($message))
   echo '<div id="error">'.$message.'</div>';
?>
<form action="<?php echo url('/pireps/mine');?>" method="post">
<dl>
   <dt>Pilot:</dt>
   <dd><strong><?php echo Auth::$userinfo->firstname . ' ' . Auth::$userinfo->lastname;?></strong>
   </dd>

   <dt>Enter Flight Number:</dt>
   <dd><input type="text" style="text-transform:uppercase" name="flightnum" value="<?php echo $_POST['flightnum'] ?>" />
   </dd>

   <dt>Departure Airport ICAO:</dt>
   <dd>
       <input type="text" style="text-transform:uppercase" name="depicao" value="<?php echo $_POST['depicao'] ?>" />
   </dd>

   <dt>Arrival Airport ICAO:</dt>
   <dd>
       <input type="text" style="text-transform:uppercase" name="arricao" value="<?php echo $_POST['arricao'] ?>" />
   </dd>

   <dt>Select Aircraft:</dt>
   <dd>
       <select name="aircraft" id="aircraft">
           <option value="">Aircraft used on this flight</option>
       <?php

       foreach($allaircraft as $aircraft)
       {
           $sel = ($_POST['aircraft'] == $aircraft->name || $bid->registration == $aircraft->registration)?'selected':'';

           echo '<option value="'.$aircraft->id.'" '.$sel.'>'.$aircraft->name.' - '.$aircraft->registration.'</option>';
       }
       ?>
       </select>
   </dd>

   <dt>Fuel Used</dt>
   <dd><input type="text" name="fuelused" value="<?php echo $_POST['fuelused']; ?>" />
       <p>This is the fuel used on this flight in <?php echo Config::Get('LIQUID_UNIT_NAMES', Config::Get('LiquidUnit'))?></p></dd>

   <dt>Flight Time</dt>
   <dd><input type="text" name="flighttime" value="<?php echo $_POST['flighttime'] ?>" />
       <p>Enter as HH.MM - "5.33" is five hrs and thirty three mins</p></dd>

   <dt>Comment</dt>
   <dd><textarea name="comment" style="width: 100%"><?php echo $_POST['comment'] ?><textarea></dd>

   <dt></dt>
   <dd><input type="submit" name="submit_pirep" value="File Flight Report" />
   </dd>
</dl>

</form>

once again many thanks in advance.

Link to comment
Share on other sites

Anyone out there help resolve this "You must fill out all of the required fields!" issue. I'm thinking it's something I haven't edited out. I think the line:-

$sel = ($_POST['aircraft'] == $aircraft->name || $bid->registration == $aircraft->registration)?'selected':'';

is at fault, but I don't know how to correct it.

Been trying to find an example that looks similar to the above but no joy. I might even be on the wrong track altogether. :( :( :)

Link to comment
Share on other sites

Greets servetas

I didn't know I had changed it apart from making sure in text input was uppercase. Is there an issue with it?

I had a look at the original and I see what you mean I removed the $bid sections as I thought they had something to do with the bid process which we have no need for.

Link to comment
Share on other sites

  • Moderators

You have to download this file and replace this with the one on your live website. The problem now is that if you do not post the field named code the system returns you this error. The code field has to be filled and you removed it from the form...

Link to comment
Share on other sites

I put your file up and the system returns 'code and number entered not a valid route' not surprising as we aren't using a schedules database. That's why I altered the flightnum in the first place. I only need it as a field entry.

thanks

Link to comment
Share on other sites

  • Moderators

Go to your core/modules/PIREPS/PIREPS.php and comment out this part: (it should start on line 358, i do not remember if i have edited that file previously)

# Only allow for valid routes to be filed
 $sched_data = SchedulesData::GetScheduleByFlight($this->post->code, $this->post->flightnum);
 if(!$sched_data)
 {
  $this->set('message', 'The flight code and number you entered is not a valid route!');
  return false;
 }

Link to comment
Share on other sites

Thank you very much servetas that's fixed it. I'm much obliged. I assume nothing else in the template needs to be removed and won't cause issues at a later date. I can't see us having any need for schedules they are all on our website anyway. Most of our people are older simmers pretty much happy with the way we do things.

Once again many thanks for your assistance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...